New error behaviour when calling `flush_tx_buffer` for several interface types
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 68/100
Research direction
Start with the BusABC class and the flush_tx_buffer() behavior introduced by PR #1724; reproduce the exception using an interface such as socketcan. Confirm that unsupported interfaces return to the previous no-op behavior without changing interfaces that implement flushing, then verify the reproduction no longer raises.
Written by the indexing model from the issue text.
Description
Describe the bug
Due to the addition of raise NotImplementedError in the BusABC class introduced with https://github.com/hardbyte/python-can/pull/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.
- Dominant language
- Python
- Stars
- 1.6k
- Forks
- 697
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hardbyte/python-can
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
hardbyte/python-can#2103 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 78/100
hardbyte/python-can#2077 · 1 comment · 1 reaction ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
hardbyte/python-can#2102 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
hardbyte/python-can#2092 ·
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 68/100
hardbyte/python-can#2091 ·
All issues in hardbyte/python-can
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
learningequality/ricecooker#747 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
run-llama/llama_index#23199 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
KhronosGroup/glTF-Blender-IO#2769 ·