Skip to content

New error behaviour when calling flush_tx_buffer for several interface types #1922

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

Open
oystub opened this issue Feb 22, 2025 · 0 comments
Open
Labels

Comments

@oystub
Copy link

oystub commented Feb 22, 2025

Describe the bug

Due to the addition of raise NotImplementedError in the BusABC class introduced with #1724 by @zariiii9003, trying to call flush_tx_buffer() throws an exception when called for any interface type that doesn't explicitly implement this.

There are several interface types in python-can which don't, including e.g. socketcan.

This breaks other tools which relied on the previous behaviour of "doing nothing" when flush_tx_buffer() was called on one of these interfaces.

To Reproduce

Call flush_tx_buffer() on an interface type that doesn't explicitly implement this method.

I noticed this because the tool pydronecan no longer works for socketcan if python-can is installed on the system.

Expected behavior

I expect the old behaviour where flushing does nothing. This can easily be done by removing the raise line, or more complicated, by implementing flush_tx_buffer() with a pass for all interface types in this repo where flushing is irrelevant.

If behavour was like this from the beginning, I would be OK with raising error. However, I think it's problematic when previous versions didn't behave like this, causing problems for tools like pydronecan. The behaviour of interfaces like this should be kept stable.

Additional context

This problem exists for every version after the PR linked above was merged. All releases after 4.4.0 are affected.

@oystub oystub added the bug label Feb 22, 2025
@oystub oystub changed the title New error when calling flush_tx_buffer for several interface types New error behaviour when calling flush_tx_buffer for several interface types Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant