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

Handle bytes more directly #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Handle bytes more directly #1

wants to merge 1 commit into from

Conversation

benesch
Copy link
Owner

@benesch benesch commented Nov 27, 2024

Since we're using a Protobuf API, pull the HTTP body as bytes rather than a string. This works around weird behavior in ord.

Depends on tidbyt/pixlet#1095.

Since we're using a Protobuf API, pull the HTTP body as bytes rather
than a string. This works around weird behavior in ord.

Depends on tidbyt/pixlet#1095.
@@ -178,6 +177,6 @@ def proto_decode_len(reader):
return out, reader

def proto_next_byte(reader):
out = reader.elem_ords()[0]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, elem_ords() actually returns the bytes values, while ord(reader[0]) when reader is a string returns 65533 for non-ASCII bytes.

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

Successfully merging this pull request may close these issues.

1 participant