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

NameError: name 'field_tyepdef' is not defined #20

Closed
iamat8080 opened this issue Jun 14, 2023 · 2 comments
Closed

NameError: name 'field_tyepdef' is not defined #20

iamat8080 opened this issue Jun 14, 2023 · 2 comments

Comments

@iamat8080
Copy link

Traceback (most recent call last):
File "D:\Newfolder\PROJECT\spotify_web_api\test.py", line 20, in
l, r = blackboxprotobuf.protobuf_to_json(data)
File "C:\Python39\lib\site-packages\blackboxprotobuf\lib\interface.py", line 75, in protobuf_to_json
value, message_type = decode_message(buf, message_type)
File "C:\Python39\lib\site-packages\blackboxprotobuf\lib\interface.py", line 62, in decode_message
value, typedef, _ = blackboxprotobuf.lib.types.length_delim.decode_message(buf, message_type)
File "C:\Python39\lib\site-packages\blackboxprotobuf\lib\types\length_delim.py", line 232, in decode_message
max(map(int, field_tyepdef['alt_typedefs'].keys()))
NameError: name 'field_tyepdef' is not defined

@iamat8080
Copy link
Author

iamat8080 commented Jun 14, 2023

it's fixed i just added in try block and used else statement but it's provide missing types
image

@iamat8080 iamat8080 reopened this Jun 15, 2023
@rwinkelmaier-ncc
Copy link
Collaborator

Hi! Sorry for the late response, I think my github notifications weren't working for a bit, but should be fixed now. I'm glad you were able to find a solution.

It looks like you're using the blackboxprotobuf pypi package, which is an older fork of this project. The bbpb package is the official package based on this repo. I've rewritten a bunch of the message parsing logic and added better testing since this, so hopefully you should encounter less bugs. Let me know if you run into the same bug with that version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants