Skip to content

TypeError: Expected unicode, got dict #280

@edoyango

Description

@edoyango

Details

  • Slurm Version: 23.02.1
  • Python Version: 3.6.15
  • Cython Version: 0.29.30
  • PySlurm Branch: main
  • Linux Distribution: Centos7

Issue

PySlurm installs correctly but when I use it in my script, it errors:

$ show_cluster
Traceback (most recent call last):
  File "/stornext/Home/data/allstaff/y/yang.e/micromamba/envs/clusterinfo-venv/bin/show_cluster", line 8, in <module>
    sys.exit(main())
  File "/stornext/Home/data/allstaff/y/yang.e/micromamba/envs/clusterinfo-venv/lib/python3.6/site-packages/clusterinfo/show_cluster.py", line 18, in main
    c.get_nodes()
  File "/stornext/Home/data/allstaff/y/yang.e/micromamba/envs/clusterinfo-venv/lib/python3.6/site-packages/clusterinfo/cluster.py", line 232, in get_nodes
    partitions = pyslurm.partition().get()
  File "pyslurm/pyslurm.pyx", line 1048, in pyslurm.pyslurm.partition.get
    Part_dict['flags'] = get_partition_mode(record.flags,
  File "pyslurm/pyslurm.pyx", line 6533, in pyslurm.pyslurm.get_partition_mode
    return __get_partition_mode(flags, max_share)
TypeError: Expected unicode, got dict

The error arises for any version of Python/gcc/Cython I use.

If I change

def get_partition_mode(uint16_t flags=0, uint16_t max_share=0) -> str:

to

def get_partition_mode(uint16_t flags=0, uint16_t max_share=0) -> dict:

on line 6523, the error is resolved. The addition of -> str seems to have been introduced in 3b89325

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions