-
Notifications
You must be signed in to change notification settings - Fork 119
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
Make the Redmine class picklable #64
Labels
Comments
rconradharris
added a commit
to rconradharris/python-redmine
that referenced
this issue
Nov 3, 2014
The `Redmine` class couldn't be pickled because the `gettatr` would attempt to turn any attribute access into a `Resource`, even `__getstate__`. The proposed fix treats attributes that begin with an underscore (and double-underscore) as non-`Resource` attributes and returns their value as-is. Fixes maxtepkeev#64
rconradharris
added a commit
to rconradharris/python-redmine
that referenced
this issue
Nov 3, 2014
The `Redmine` class couldn't be pickled because the `gettatr` would attempt to turn any attribute access into a `Resource`, even `__getstate__`. The proposed fix treats attributes that begin with an underscore (and double-underscore) as non-`Resource` attributes and returns their value as-is. Fixes maxtepkeev#64
rconradharris
added a commit
to rconradharris/python-redmine
that referenced
this issue
Nov 4, 2014
The `Redmine` class couldn't be pickled because the `gettatr` would attempt to turn any attribute access into a `Resource`, even `__getstate__`. The proposed fix treats attributes that begin with an underscore (and double-underscore) as non-`Resource` attributes. Fixes maxtepkeev#64
rconradharris
added a commit
to rconradharris/python-redmine
that referenced
this issue
Nov 4, 2014
The `Redmine` class couldn't be pickled because the `gettatr` would attempt to turn any attribute access into a `Resource`, even `__getstate__`. The proposed fix treats attributes that begin with an underscore (and double-underscore) as non-`Resource` attributes. Fixes maxtepkeev#64
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current
getattr
code attempts to create aResource
for any attribute accessed.If an object that has a reference to
Redmine
is pickled, it will attempt to access `getstate`` which, in turn, will cause an exception likeThe proposed fix is to make
Redmine
'sgetattr
raise anAttributeError
the under-under methods. This will mean that__getstate__
is skipped.Tested this approach and it worked.
The text was updated successfully, but these errors were encountered: