Thanks for everyone's help and thoughts. I agree that this behavior is
buggy. I submitted a bug report to the python project at sourceforge,
with a link to this thread. Hopefully the report will be helpful.
tim
Charles R Harris wrote:
>
>
> On 12/12/06, *Travis Oliphant* <[EMAIL PROTECTED]
On 12/12/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:
Tim Hirzel wrote:
>Good thought Chris,
>Normal reading and writing does seem to work. ..
>But, my friend Daniel figured out a workaround when I asked to confirm
>this behavior on his windows setup (and it is does behave the same for
>him).
>
> It seems to me that the temporary file mechanism on Windows is a little
> odd.
>
Indeed, looking at sources, the posix version uses the mkstemp/unlink
idiom.. but in win it uses a bit of hackery. It seems opened files
cannot be unlinked.
if _os.name != 'posix' or _os.sys.platform == 'cygwin'
Tim Hirzel wrote:
>Good thought Chris,
>Normal reading and writing does seem to work. ..
>But, my friend Daniel figured out a workaround when I asked to confirm
>this behavior on his windows setup (and it is does behave the same for
>him). The first clue was this:
>
> >>> f = tempfile.Temporar
Good thought Chris,
Normal reading and writing does seem to work. ..
But, my friend Daniel figured out a workaround when I asked to confirm
this behavior on his windows setup (and it is does behave the same for
him). The first clue was this:
>>> f = tempfile.TemporaryFile()
>>> type(f)
>>>
did you try reading and writing to/from that temp file with regular old
python functions?
-Chris
Tim Hirzel wrote:
>> I'm running linux and the current svn version of numpy. Maybe the
>> problem is with the tempfile module on windows. Do fromfile and tofile
>> work for files opened normally?
> I'm running linux and the current svn version of numpy. Maybe the
> problem is with the tempfile module on windows. Do fromfile and tofile
> work for files opened normally?
>
> Chuck
fromfile and tofile work fine on regular files. From skimming the code
a bit, it's hard to imagine numpy cod
On 12/12/06, Tim Hirzel <[EMAIL PROTECTED]> wrote:
Hi Chuck,
Thanks for checking that. I am running numpy 1.0.1 in python 2.4 on
win32 (xp). Are you on linux? I double checked the behavior in 1.0
and 1.0.1, just to be extra sure, and it thows the IOError in both cases.
tim
I'm running lin
Hi Chuck,
Thanks for checking that. I am running numpy 1.0.1 in python 2.4 on
win32 (xp). Are you on linux? I double checked the behavior in 1.0
and 1.0.1, just to be extra sure, and it thows the IOError in both cases.
tim
Charles R Harris wrote:
>
>
> On 12/11/06, *Tim Hirzel* <[EMAIL PROTE
On 12/11/06, Tim Hirzel <[EMAIL PROTECTED]> wrote:
Hi,
Does anyone know how to get fromfile and tofile to work from a
tempfile.TemporaryFile? Or if its not possible?
I am getting this:
>>> import tempfile
>>> f = tempfile.TemporaryFile()
>>> f
', mode 'w+b' at 0x01EE1728>
>>> a = numpy.arange(
Hi,
Does anyone know how to get fromfile and tofile to work from a
tempfile.TemporaryFile? Or if its not possible?
I am getting this:
>>> import tempfile
>>> f = tempfile.TemporaryFile()
>>> f
', mode 'w+b' at 0x01EE1728>
>>> a = numpy.arange(10)
>>> a.tofile(f)
Traceback (most recent call
11 matches
Mail list logo