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

Fix for type error caused by appending byte arrays to empty string #507

Merged

Conversation

connormbrooks
Copy link
Contributor

Fixes a TypeError caused when clients send incoming message as byte arrays. This error is introduced in ROS 2 due to Python 3's introduction of byte arrays distinct from strings.

@mvollrath
Copy link
Contributor

It looks like if self.buffer is a non-zero-length str and a bytearray comes in it will raise a TypeError then continue to raise more TypeError for each bytearray until another str comes in to clear self.buffer.

@connormbrooks
Copy link
Contributor Author

connormbrooks commented Jun 3, 2020

Yes - this still retains the error if byte arrays and strings are intermixed, although it fixes the issue if a client is only sending one or the other.

Copy link
Contributor

@mvollrath mvollrath left a comment

Choose a reason for hiding this comment

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

Thank you 👍

@mvollrath mvollrath merged commit 1e21dd0 into RobotWebTools:ros2 Jun 3, 2020
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.

None yet

2 participants