[Python-3000] Py3k_struni additional test failures under cygwin

Joe Smith unknown_kev_cat at hotmail.com
Sun Jul 29 22:11:12 CEST 2007


"Guido van Rossum" <guido at python.org> wrote in message 
news:ca471dc20707181158p17417c9cg37c5382d61b53fe5 at mail.gmail.com...
> On 7/18/07, Joe Smith <unknown_kev_cat at hotmail.com> wrote:
>> >> I'm wondering if the recusion limit on my build is getting set too low
>> >> somehow.
>> >
>> > Can you find out what it is? sys.getrecursionlimit().
>>
>> Hmm...  It is a limit of 1000.
>> That is probably large enough, no?
>
> Yes, that's what it is for me.
>
>> Anyway, from some basic testing it looks like marshal is always throwing
>> that error when marshal.load() is called.
>> However, marshal.loads() works fine.
>>
>> Might this be another encoding related error?
>
> Perhaps. Or something else. Do try to investigate.
>

What I have found is that (on CYGWIN) all of marshal seems to work fine 
except for marshal.load().
marshal.dump()'s output can be read by 2.5's marshal.load() without problem. 
3k's marshal.load() will not
load the data from 3k's marshal.dump or 2.5's marshal.dump()

It turns out to be a fault due to an uninitialized value on a RFILE.
Specifically, the following patch (part of marshal_load in marshal.c fixes 
things.

-----BEGIN PATCH-----
Index: Python/marshal.c
===================================================================
--- Python/marshal.c    (revision 56620)
+++ Python/marshal.c    (working copy)
@@ -1181,6 +1181,7 @@
                return NULL;
        }
        rf.strings = PyList_New(0);
+       rf.depth=0;
        result = read_object(&rf);
        Py_DECREF(rf.strings);
        Py_DECREF(data);
-----END PATCH-----

I'll submit the patch to sourceforge if needed, although the fact that all 
the other loading methods
do set rf.depth=0 (including PyMarshal_ReadObjectFromFile) indicates to me 
that this is definately the correct patch.
Looks like that line was accidentally forgoten.




More information about the Python-3000 mailing list