Skip to content

Conversation

@barnabasbusa
Copy link

Changed types of topicID and messageIDs from string to bytes in ControlIHave and ControlIWant messages.

This change is required due to this error message I saw:

iwant_msg.messageIDs.extend(msg_ids)
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x95

This happened because msg_ids contained raw binary hashes (arbitrary bytes), and when extending a repeated string field, Python's protobuf tries to decode them as UTF-8.

What was wrong?

Issue #

How was it fixed?

Summary of approach.

To-Do

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

put a cute animal picture link inside the parentheses

Changed types of topicID and messageIDs from string to bytes in ControlIHave and ControlIWant messages.

This change is required due to this error message I saw:
```
iwant_msg.messageIDs.extend(msg_ids)
  UnicodeDecodeError: 'utf-8' codec can't decode byte 0x95
```

This happened because msg_ids contained raw binary hashes (arbitrary bytes), and when extending a repeated string field, Python's protobuf tries to decode them as UTF-8.
@barnabasbusa
Copy link
Author

@acul71 mind taking a quick look? Shouldn't affect much, but would really help for me to be able to use latest upstream again.

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