Message203138
marshal.c does a check that the 2nd arg is a subclass of the builtin file class. On non-Posix platforms, TemporaryFile is a wrapper class providing context manager support for delete-on-close. This fails the subclass test.
The docs for TemporaryFile:
http://docs.python.org/2/library/tempfile.html?highlight=temporaryfile#tempfile.TemporaryFile
do state that, on non-Posix systems, the object is not a true file. The docs for marshal:
http://docs.python.org/2/library/marshal.html?highlight=marshal#marshal.dump
more or less state the 2nd param must be a true file object. So I think we're within rights here. But I accept that it's not an ideal. The best we can opt for here, I think, is a doc patch to marshal.dump reinforcing that the file must a true file.
BTW, why are you marshalling into a file which will be deleted as soon as it's closed? |
|
Date |
User |
Action |
Args |
2013-11-17 10:58:36 | tim.golden | set | recipients:
+ tim.golden, Gregory.Salvan, lm1 |
2013-11-17 10:58:36 | tim.golden | set | messageid: <1384685916.9.0.912432901925.issue19630@psf.upfronthosting.co.za> |
2013-11-17 10:58:36 | tim.golden | link | issue19630 messages |
2013-11-17 10:58:36 | tim.golden | create | |
|