Skip to content

When the API is super down, the API client behaves poorly #45

@grahamc

Description

@grahamc

I got:

Traceback (most recent call last):
  File "./import.py", line 121, in <module>
    for device in get_devices(manager):
  File "./import.py", line 88, in get_devices
    data = manager.call_api(page)
  File "/nix/store/fn8qkd9vnr2p65707r6lwvpk9l3z29h5-python3-3.7.3-env/lib/python3.7/site-packages/packet/Manager.py", line 19, in call_api
    return super(Manager, self).call_api(method, type, params)
  File "/nix/store/fn8qkd9vnr2p65707r6lwvpk9l3z29h5-python3-3.7.3-env/lib/python3.7/site-packages/packet/baseapi.py", line 79, in call_api
    elif 'errors' in data:
TypeError: a bytes-like object is required, not 'str'

Turns out the API is replying with (in Python notation) b'Forbidden\n'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions