Message172993
This report is to re-raise an old issue from 2009:
http://bugs.python.org/issue5370
Although that issue is marked as "fixed", I disagree that it was ever "fixed", and spent an evil day tracking it down.
Use Case:
- take two 3rd party packages: django and django-crispy-forms
- django, deep in its inner-workings, uses Pickle
- django-cripsy-forms implements the _getattr__ method in one of it's classes
- when you put the two together such that django pickles a form, the python interpreter goes into a tailspin in very sinister and hard-to-track-down ways (different behaviour in 2.5, 2.6, 2.7, as noted in issue5370, which includes a simple test case)
The "resolution" for issue5370 was to add some documentation to Pickle. But I would argue this is insufficient - the implementer of django-crispy-forms would have no reason to ever look at the Pickle docs, and so is very likely to implement this bug (which s/he did).
Perhaps, if this issue cannot be resolved in code, as suggested by gagenellina back in 2009, at least some documentation could be added to __getattr__ (and others) warning that these methods could potentially be called before __init__ (similar to the documentation added to Pickle)? I'd be happy to draft a small bit of documentation for this, although if someone can think of a way to simply resolve this in Pickle so it does not cause the issue in the first place, that seems to me ideal.
A test case is included with issue5370 |
|
Date |
User |
Action |
Args |
2012-10-15 18:11:13 | powderflask | set | recipients:
+ powderflask, docs@python |
2012-10-15 18:11:13 | powderflask | set | messageid: <1350324673.62.0.567343854306.issue16242@psf.upfronthosting.co.za> |
2012-10-15 18:11:13 | powderflask | link | issue16242 messages |
2012-10-15 18:11:13 | powderflask | create | |
|