Message157093
In Python 3.2, if you write several values to a file with multiple calls to marshal.dump(), and then try to read them back, the first marshal.load() returns the first value, but reads to the end of the file, so subsequent calls to marshal.load() raise an EOFError.
E.g.:
import marshal
f = open("test", "wb")
marshal.dump(("hello", 1), f)
marshal.dump(("there", 2), f)
marshal.dump(("friend", 3), f)
f.close()
f = open("test", "rb")
print(marshal.load(f)) # ('hello', 1)
print(marshal.load(f)) # ERROR
This page seems to indicate this was also a bug in Python 3.1: http://www.velocityreviews.com/forums/t728526-python-3-1-2-and-marshal.html |
|
Date |
User |
Action |
Args |
2012-03-29 20:10:46 | mattchaput | set | recipients:
+ mattchaput |
2012-03-29 20:10:46 | mattchaput | set | messageid: <1333051846.5.0.756553660947.issue14447@psf.upfronthosting.co.za> |
2012-03-29 20:10:45 | mattchaput | link | issue14447 messages |
2012-03-29 20:10:45 | mattchaput | create | |
|