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 decoding error in Kvaser constructor for non-ASCII product name #1613

Merged
merged 3 commits into from
Jun 13, 2023

Conversation

lumagi
Copy link
Collaborator

@lumagi lumagi commented Jun 11, 2023

The PR will change the constructor to be less susceptible to non-ASCII characters in the device description.

Previously, illegal characters triggered an exception.
With the new behavior, illegal characters will be replaced
with a placeholder value.
@lumagi lumagi force-pushed the fix/kvaser_channel_charset branch from 40ced11 to d3de662 Compare June 11, 2023 20:54
@lumagi lumagi marked this pull request as ready for review June 11, 2023 21:09
@lumagi lumagi requested a review from zariiii9003 June 11, 2023 21:21
@lumagi lumagi changed the title Fix decoding error in Kvaser constructor for non-ASCII channel description Fix decoding error in Kvaser constructor for non-ASCII product name Jun 11, 2023
@zariiii9003
Copy link
Collaborator

@lumagi do you have a Kvaser interface for testing?

@lumagi
Copy link
Collaborator Author

lumagi commented Jun 13, 2023

Unfortunately, no. All I can offer is PEAK, ETAS, or Vector.

Copy link
Collaborator

@zariiii9003 zariiii9003 left a comment

Choose a reason for hiding this comment

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

Looks good, thank you :)

@zariiii9003 zariiii9003 merged commit 67324f1 into hardbyte:develop Jun 13, 2023
zariiii9003 pushed a commit to zariiii9003/python-can that referenced this pull request Jun 18, 2023
…ardbyte#1613)

* Implement test to trigger ASCII decoding error in Kvaser bus constructor

* Change handling of invalid chars in Kvaser device name

Previously, illegal characters triggered an exception.
With the new behavior, illegal characters will be replaced
with a placeholder value.

* Rename variables in test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decoding device name with chinese characters fails
2 participants