Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Object of type bytes is not JSON serializable - DownloadsEndpoint #7836

Closed
xoriole opened this issue Jan 18, 2024 · 0 comments · Fixed by #7842
Closed

TypeError: Object of type bytes is not JSON serializable - DownloadsEndpoint #7836

xoriole opened this issue Jan 18, 2024 · 0 comments · Fixed by #7842
Assignees
Milestone

Comments

@xoriole
Copy link
Contributor

xoriole commented Jan 18, 2024

Encountered when running application tester on main branch from source.

Traceback (most recent call last):
  File "/home/user/tribler/src/tribler/core/components/restapi/rest/rest_manager.py", line 53, in error_middleware
    response = await handler(request)
  File "/home/user/tribler/venv/<discount>/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/home/user/tribler/src/tribler/core/components/libtorrent/restapi/downloads_endpoint.py", line 379, in get_downloads
    return RESTResponse({"downloads": downloads_json, "checkpoints": checkpoints})
  File "/home/user/tribler/src/tribler/core/components/restapi/rest/rest_endpoint.py", line 66, in __init__
    body = json.dumps(body)
  File "/usr/<discount>/python3.10/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/<discount>/python3.10/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/<discount>/python3.10/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/<discount>/python3.10/json/encoder.py", line 179, in default
    raise TypeError(f\'Object of type {o.__class__.__name__} \'
TypeError: Object of type bytes is not JSON serializable

Additional tags:

{
  'source': 'core',
  'tribler_stopped': False,
  'version': '7.14.0-GIT',
  'machine': 'x86_64',
  'os': 'Linux-6.5.0-14-generic-x86_64-with-glibc2.35',
  'platform': 'linux'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant