Pickle translation

William Annis annis at biostat.wisc.edu
Thu Jul 12 09:52:00 EDT 2001


Skip Montanaro <skip at pobox.com> writes:

>     William> Traceback (most recent call last):
>     William>   File "bin/momd", line 83, in ?
>     William>     kserv = load(f)
>     William> ValueError: invalid \x escape
> 
> Interpretation of \x escapes was tightened up in 2.0 I believe.

        Am I supposed to be able to find "\x" somewhere in the pickle
file itself?  No such thing exists.

> I'm not sure what the solution is.  Someone with more pickle/string/
> internals knowledge will probably have some ideas.

        In the off chance someone gets some hints from this:

------------------------------
wazor /u/annis/code/NewMom $ python2.1 -i bin/momd
Traceback (most recent call last):
  File "bin/momd", line 83, in ?
    kserv = load(f)
ValueError: invalid \x escape
>>> import pdb
>>> pdb.pm()
> /u/u01/a/annis/code/NewMom/bin/momd(83)?()
-> kserv = load(f)
(Pdb) p f
<open file '/u/annis/code/NewMom/mstate', mode 'r' at 20d808>
(Pdb) p f.tell()
823962
(Pdb) 
------------------------------
# Then I open the pickle file in my trusty swiss-army editor, Emacs,
# and forward-char 823962 times, and this is where I end up:
<snip>
g29
ssg34
g62
sg36
I1
sg37
S'Holt-Winters models on base load and net'
sba(iKiosk.transports.stranger_e
stranger_e
p772                            **** first char of this line
(dp773
g29
(dp774
g31
g32
<snip>
------------------------------
It's all quite mystifying to me, and I've tackled it several times in
the last two months.

-- 
William Annis - System Administrator - Biomedical Computing Group
annis at biostat.wisc.edu                       PGP ID:1024/FBF64031
Mi parolas Esperanton - La Internacian Lingvon  www.esperanto.org



More information about the Python-list mailing list