This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tim.golden
Recipients Gregory.Salvan, lm1, tim.golden
Date 2013-11-17.10:58:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384685916.9.0.912432901925.issue19630@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2013-11-17 10:58:36tim.goldensetrecipients: + tim.golden, Gregory.Salvan, lm1
2013-11-17 10:58:36tim.goldensetmessageid: <1384685916.9.0.912432901925.issue19630@psf.upfronthosting.co.za>
2013-11-17 10:58:36tim.goldenlinkissue19630 messages
2013-11-17 10:58:36tim.goldencreate