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

[bug] Using UDP communication, some statements fail to match because line breaks are not cleanly filtered #174

Open
wants to merge 2 commits into
base: ros2
Choose a base branch
from

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