[issue19630] marshal.dump cannot write to temporary file

2014-04-29 Thread Tim Golden
Tim Golden added the comment: I updated the docs to emphasise that the file parameter to marshal.dump must be a real file, not a wrapper. -- assignee: -> tim.golden status: open -> closed ___ Python tracker _

[issue19630] marshal.dump cannot write to temporary file

2014-04-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0f6bdc2b0e38 by Tim Golden in branch '2.7': Issue #19630 Emphasise that the file parameter to marshal.dump must be a real file object http://hg.python.org/cpython/rev/0f6bdc2b0e38 -- nosy: +python-dev __

[issue19630] marshal.dump cannot write to temporary file

2013-11-17 Thread STINNER Victor
STINNER Victor added the comment: I cannot reproduce the issue on Python 3 (on Linux), I suppose that it is specific to Python 2. On Python 3, mashal.dump(obj, fileobj) only calls fileobj.write(data), no test on fileobj type is done. -- nosy: +haypo __

[issue19630] marshal.dump cannot write to temporary file

2013-11-17 Thread Tim Golden
Changes by Tim Golden : -- resolution: -> wont fix stage: -> committed/rejected ___ Python tracker ___ ___ Python-bugs-list mailing

[issue19630] marshal.dump cannot write to temporary file

2013-11-17 Thread Lukasz Mielicki
Lukasz Mielicki added the comment: Thank you for detailed explanation. Too bad tempfile is inherently non-portable, but I'm fine with marshal.dumps as a w/a in this case. I marshal to a temporary file to serialize input for Perforce command line client which is capable of accepting marshaled Pyt

[issue19630] marshal.dump cannot write to temporary file

2013-11-17 Thread Tim Golden
Tim Golden added the comment: 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.

[issue19630] marshal.dump cannot write to temporary file

2013-11-17 Thread Gregory Salvan
Gregory Salvan added the comment: Sorry I don't have windows to test. Try to set the temporary directory to a path you're sure you've rights, either by setting tempfile.tempdir (http://docs.python.org/2/library/tempfile.html#tempfile.tempdir) or by adding the argument dir="C:\\user\path" in t

[issue19630] marshal.dump cannot write to temporary file

2013-11-17 Thread Lukasz Mielicki
Lukasz Mielicki added the comment: I'm seeing this on Windows with Python 2.7.6 (amd64). I can write to the same file with other methods. On 17 November 2013 18:36, Gregory Salvan wrote: > > Gregory Salvan added the comment: > > I can't reproduce this issue (on linux). > Are you sure you've ne

[issue19630] marshal.dump cannot write to temporary file

2013-11-17 Thread Gregory Salvan
Gregory Salvan added the comment: I can't reproduce this issue (on linux). Are you sure you've necessary rights to write to tempdir ? -- nosy: +Gregory.Salvan ___ Python tracker

[issue19630] marshal.dump cannot write to temporary file

2013-11-17 Thread Lukasz Mielicki
New submission from Lukasz Mielicki: marshal.dump yields error when temporary file is given as a second argument. import tempfile import marshal tmpfile = tempfile.TemporaryFile(mode='w+b') # TypeError: marshal.dump() 2nd arg must be file marshal.dump({}, tmpfile) -- components: Library