Skip to content

dict_keys is not JSON serializable #258

@AstraLuma

Description

@AstraLuma

If you call Project.services.available():

Traceback (most recent call last):
  File "/home/jbliss/miniconda3/envs/xonsh/lib/python3.6/site-packages/gitlab/objects.py", line 2141, in available
    return json.dumps(ProjectService._service_attrs.keys())
  File "/home/jbliss/miniconda3/envs/xonsh/lib/python3.6/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/home/jbliss/miniconda3/envs/xonsh/lib/python3.6/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/home/jbliss/miniconda3/envs/xonsh/lib/python3.6/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/home/jbliss/miniconda3/envs/xonsh/lib/python3.6/json/encoder.py", line 180, in default
    o.__class__.__name__)
TypeError: Object of type 'dict_keys' is not JSON serializable

Python 3.6.1

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