Skip to content

Conversation

@hannesweisbach
Copy link
Contributor

pycyphal.application.file.RemoteFileError was introduced as common exception base class/tag type to catch exceptions resulting from remote file operations using the Cyphal remote file system interface.

In Python exceptions must inherit from BaseException, otherwise a TypeError will occur:

TypeError: exceptions must derive from BaseException

RemoteFileError does not inherit from BaseException and can't thus be used in except clauses.

This fix lets RemoteFileError inherit from RuntimeError, so that RemoteFileError can be used as intended.

this fixes commit 40e1482

Copy link
Member

@pavel-kirienko pavel-kirienko left a comment

Choose a reason for hiding this comment

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

Thank you, this is good. Please bump the patch version number in version.py, as described in CONTRIBUTING.md (you should read that)

@hannesweisbach
Copy link
Contributor Author

Hm, I'm not sure if this is a major change. If I consider RemoteFileError as part of the API, then this would require a major version, no?

@pavel-kirienko
Copy link
Member

It's worthy of a patch version bump only, since this is a fix that doesn't affect backward compatibility of the API

pycyphal.application.file.RemoteFileError was introduced as common exception
base class/tag type to catch exceptions resulting from remote file operations
using the Cyphal remote file system interface.

In Python exceptions must inherit from BaseException, otherwise a TypeError
will occur:

TypeError: exceptions must derive from BaseException

RemoteFileError does not inherit from BaseException and can't thus be used in
except clauses.

This fix lets RemoteFileError inherit from RuntimeError, so that
RemoteFileError can be used as intended.

this fixes commit 40e1482

Signed-off-by: Hannes Weisbach <[email protected]>
@hannesweisbach hannesweisbach force-pushed the fix-remote-file-exception branch from 0849126 to f9eb722 Compare April 25, 2025 10:46
@pavel-kirienko
Copy link
Member

Thank you! I have moved your commit to the dev branch and I will merge it next.

pavel-kirienko added a commit that referenced this pull request May 12, 2025
…emo.rst; add USBtingo CAN FD support (#352)

- #348
- #347
- #344

---------

Signed-off-by: Hannes Weisbach <[email protected]>
Co-authored-by: d <[email protected]>
Co-authored-by: Hannes Weisbach <[email protected]>
Co-authored-by: Lasse Fröhner <[email protected]>
@hannesweisbach hannesweisbach deleted the fix-remote-file-exception branch June 18, 2025 05:55
@hannesweisbach hannesweisbach restored the fix-remote-file-exception branch June 18, 2025 05:55
@hannesweisbach hannesweisbach deleted the fix-remote-file-exception branch June 18, 2025 05:56
@hannesweisbach hannesweisbach restored the fix-remote-file-exception branch June 18, 2025 05:56
@hannesweisbach hannesweisbach deleted the fix-remote-file-exception branch June 26, 2025 07:06
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.

2 participants