Message158257
| Author |
michael.foord |
| Recipients |
alexandre.vassalotti, michael.foord, pitrou |
| Date |
2012年04月14日.11:28:27 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1334402907.76.0.119360990832.issue14577@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
So, changing copyreg.py to use type(self) instead of self.__class__ isn't sufficient. _pickle accesses __class__ as well it seems. However I'm running all tests with this change in place to see if it breaks intended behaviour:
Python 3.3.0a1+ (default:51016ff7f8c9, Mar 26 2012, 13:15:33)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle as p
[70240 refs]
>>> class Foo(object):
... __class__ = property(lambda s: int)
...
[70290 refs]
>>> Foo().__class__
<class 'int'>
[70294 refs]
>>> p.dumps(Foo())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
_pickle.PicklingError: args[0] from __newobj__ args has the wrong class |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年04月14日 11:28:27 | michael.foord | set | recipients:
+ michael.foord, pitrou, alexandre.vassalotti |
| 2012年04月14日 11:28:27 | michael.foord | set | messageid: <1334402907.76.0.119360990832.issue14577@psf.upfronthosting.co.za> |
| 2012年04月14日 11:28:27 | michael.foord | link | issue14577 messages |
| 2012年04月14日 11:28:27 | michael.foord | create |
|