[ python-Bugs-1615275 ] tempile.TemporaryFile differences between linux and windows
SourceForge.net
noreply at sourceforge.net
Wed Dec 13 22:20:55 CET 2006
Bugs item #1615275, was opened at 2006-12-13 16:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1615275&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: hirzel (hirzel)
Assigned to: Nobody/Anonymous (nobody)
Summary: tempile.TemporaryFile differences between linux and windows
Initial Comment:
This bug came up when trying to write a numpy array to a tempfile.TemporaryFile() using the numpy 'tofile' method on windows using python 2.4.
with a numpy array 'a', and a TemporaryFile 'f',
on windows:
>>> a.tofile(f)
throws an IOError, where on Linux it does not.
On windows, you must use a.tofile(f.file)
The cause of this difference is that in windows, tempfile.TemporaryFile() returns <type 'instance'> that has a 'file' attribute of <type 'file'>, whereas in linux tempfile.TemporaryFile() returns <type 'file'> and there is no 'file' attribute.
Ideally, the windows version would align with linux, and the module documentation and TemporaryFile() would return a <type 'file'>. If this is not possible, it seems like the linux version and docs should be changed to match the windows version to align cross-platform behavior. At least, that seems to be the shared opinion of this thread from the mailing list: numpy-discussion. http://www.mail-archive.com/numpy-discussion@scipy.org/msg00271.html
To my knowledge, while platform differences in tempfile have been reported in the past, this one has not.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1615275&group_id=5470
More information about the Python-bugs-list
mailing list