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

python-can 3.3.4 breaks functionality in a minor version #919

Closed
albireox opened this issue Oct 11, 2020 · 4 comments
Closed

python-can 3.3.4 breaks functionality in a minor version #919

albireox opened this issue Oct 11, 2020 · 4 comments
Labels

Comments

@albireox
Copy link

Commit 0c34e50 introduced this change in message.py

if key not in self.__slots__:
    raise AttributeError

This effectively disables the use of custom attributes in Message. It seems that's planned for version 4.0, but this change breaks any code that adds attributes to Message and does so in a patch version instead of a major one.

@hardbyte
Copy link
Owner

Thanks for reporting, if there is a clean way to still support custom attributes l'm happy to make a quick 3.3.5 release.

I'll note that we documented custom attributes on the Message class haven't been supported since the 3.0 release (See the Message docs)

Messages do not support “dynamic” attributes, meaning any others that the documented ones.

@karlding this was introduced from fixing #804, ensuring a message can be pickled. Any ideas for how can we might continue to support both custom attributes and pickling?

@albireox
Copy link
Author

Thanks for the quick reply. For some reason I don't think I've ever seen one of the deprecation warnings, so I wasn't aware of this change. On my side I've updated my code to use a subclass of Message in which I override __slots__ to add my custom attributes, and I expect that will work fine for any version before or after 3.3.4, but I wanted to alert of the problem because I assume other users may be in the same situation.

@felixdivo
Copy link
Collaborator

Is there still some action needed on this?

@hardbyte
Copy link
Owner

I don't think any PRs were opened to fix 3.3.4, and there haven't been any other comments in half a year so I think it is safe to close.

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

3 participants