Message6613
Doing a file.seek(N, 1) fails for files opened in read/write mode ("r+" or "rb+"). This first manifested for me with mutagen corrupting m4a files when writing tags.
Output from the attached script (on two different systems, Linux and OS-X) gives:
--- OS-X ---
$ python ./script/test-seek.py
Python 2.6.1
Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64
No errors
$ jython ./script/test-seek.py
Jython 2.5.2
Java HotSpot(TM) 64-Bit Server VM, 20.1-b02-384, Apple Inc.
Traceback (most recent call last):
File "./script/test-seek.py", line 31, in <module>
assert f.tell() == x, "before read: pos should be %d but was %d" % (x, f.tell())
AssertionError: before read: pos should be 253 but was 254
--- Linux ---
$ python script/test-seek.py
Python 2.7.1+
#42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011
No errors
$ java -jar target/lib/jython-standalone-2.5.2.jar script/test-seek.py
Jython 2.5.2
OpenJDK Server VM, 20.0-b11, Sun Microsystems Inc.
Traceback (most recent call last):
File "script/test-seek.py", line 31, in <module>
assert f.tell() == x, "before read: pos should be %d but was %d" % (x, f.tell())
AssertionError: before read: pos should be 253 but was 254 |
|
Date |
User |
Action |
Args |
2011-08-24 23:08:21 | tuck182 | set | recipients:
+ tuck182 |
2011-08-24 23:08:20 | tuck182 | set | messageid: <1314227300.98.0.611647527186.issue1793@psf.upfronthosting.co.za> |
2011-08-24 23:08:20 | tuck182 | link | issue1793 messages |
2011-08-24 23:08:20 | tuck182 | create | |
|