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

Parsing of profile img may fail for corner-cases when running experimental / next #159

Open
jonasbardino opened this issue Dec 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jonasbardino
Copy link
Contributor

jonasbardino commented Dec 10, 2024

The crash ends up something like:

TypeError: a bytes-like object is required, not 'str'
Traceback (most recent call last):
  File "/home/mig/mig/wsgi-bin/migwsgi.py", line 124, in stub
    (output_objects, (ret_code, ret_msg)) = main(client_id,
  File "/home/mig/mig/shared/functionality/viewuser.py", line 244, in main
    user_item = build_useritem_object_from_user_dict(configuration,
  File "/home/mig/mig/shared/functionality/viewuser.py", line 113, in build_useritem_object_from_user_dict
    img_data = inline_image(configuration, img_path)
  File "/home/mig/mig/shared/user.py", line 151, in inline_image
    img_data = ''
  File "/usr/lib64/python3.9/base64.py", line 58, in b64encode
    encoded = binascii.b2a_base64(s, newline=False)

when a bogus empty string is found and we try to do byte vs str conversion assuming a non-empty string.

@jonasbardino jonasbardino added the bug Something isn't working label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant