[qmtest] PATCH: Make PickleResultReader handle StringIO files
Nathaniel Smith
njs at pobox.com
Sun Sep 28 23:33:38 UTC 2003
On Sun, Sep 28, 2003 at 04:04:53PM -0700, Mark Mitchell wrote:
> When the ResultReader abstraction was created, this code (which was in
> load_outcomes) did not get moved into the PickleResultReader class.
> Nathaniel, did you make this change purposefully, or was it just an
> accident?
I made it on purpose. The old code treated both 'EOFError's and
'UnpickleableError's as marking end-of-file, with a comment that the
latter was required because of buggy interaction between cPickle and
cStringIO. I checked with a 2.2 interpreter, and found that this
buggy interaction didn't occur. Just now:
~$ python2.2
Python 2.2.3 (#1, Jun 4 2003, 02:54:59)
[GCC 3.3 (Debian)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cStringIO
>>> import cPickle
>>> up = cPickle.Unpickler(cStringIO.StringIO(""))
>>> up.load()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
EOFError
>>>
... so I figured it was yet another bit of cruft left over from Python
1.4 or whatever, and stripped it out.
It sounds like I should have checked an even earlier version of 2.2?
The Redhat 7.3 box I have access seems to have 2.2.2 installed, and it
works just like 2.2.3. But I guess 2.2.0 or 2.2.1 were still broken?
Oops.
-- Nathaniel
--
"On arrival in my ward I was immediately served with lunch. `This is
what you ordered yesterday.' I pointed out that I had just arrived,
only to be told: `This is what your bed ordered.'"
-- Letter to the Editor, The Times, September 2000
More information about the qmtest
mailing list