M
Michael George Lerner
I was helping someone debug his code today .. it worked fine on Linux, but
gave a strange error message on Windows. Here's the snippet that goes
wrong in Python 2.2 under Windows (it also happens under 2.3a1 under
Windows and Enthought's 2.3.3, so I think it's pretty generic) .. :
Traceback (most recent call last):
File "<pyshell#48>", line 1, in ?
f.write('beep')
IOError: (0, 'Error')
but .. I can make things work by seeking:
I don't know whether it's important or not, but if I do an f.tell() after
the readline(), it says 0L, which seems reasonable.
For comparison (and this is also true under, e.g., Linux 2.3a1),
bash-2.04$ python
Python 2.2 (#1, Feb 18 2002, 14:48:51) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
What's going on here? Should I expect this behavior? I've never needed
to use a+ mode before .. is it just known to be funny or have interesting
cross-platform issues?
Thanks,
-michael
gave a strange error message on Windows. Here's the snippet that goes
wrong in Python 2.2 under Windows (it also happens under 2.3a1 under
Windows and Enthought's 2.3.3, so I think it's pretty generic) .. :
Traceback (most recent call last):
File "<pyshell#48>", line 1, in ?
f.write('beep')
IOError: (0, 'Error')
but .. I can make things work by seeking:
I don't know whether it's important or not, but if I do an f.tell() after
the readline(), it says 0L, which seems reasonable.
For comparison (and this is also true under, e.g., Linux 2.3a1),
bash-2.04$ python
Python 2.2 (#1, Feb 18 2002, 14:48:51) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
What's going on here? Should I expect this behavior? I've never needed
to use a+ mode before .. is it just known to be funny or have interesting
cross-platform issues?
Thanks,
-michael