[issue19630] marshal.dump cannot write to temporary file
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 (Lib) messages: 203125 nosy: lm1 priority: normal severity: normal status: open title: marshal.dump cannot write to temporary file type: behavior versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19630 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19630] marshal.dump cannot write to temporary file
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 rep...@bugs.python.org wrote: 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 rep...@bugs.python.org http://bugs.python.org/issue19630 ___ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19630 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19630] marshal.dump cannot write to temporary file
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 Python objects as input for some commands. Unfortunately writing directly to its stdin deadlocks (at least on Windows, where streams seems not be fully buffered). My guess is that Perforce client performs seek to end of file before reading it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19630 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com