Skip to content

Conversation

@zymouse
Copy link

@zymouse zymouse commented Jan 9, 2024

Fix the problem: #171
It's been tested in real life.

  • branch: ros2
  • commint:548c84a469bf723ee911d824c33fa50b87106fc1

Copy link
Collaborator

@evenator evenator left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution. I did a little bit of experimenting with this code, and I've proposed a small change.

partial = ""
else:
full_lines = lines[:-1]
partial = lines[-1]
Copy link
Collaborator

Choose a reason for hiding this comment

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

If there's no data decoded and partial is an empty string, lines will be an empty list, and this line will raise an IndexError.

Copy link
Collaborator

Choose a reason for hiding this comment

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

A solution would be to add a continue on line 84:

if not partial:
  continue

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.

3 participants