Guido van Rossum added the comment:
I'll look at this at some point. One quick comment: the lnotab and bytecode
should use PyString, which will be 'bytes' in 3.0a2. They must be immutable
because code objects must be immutable (it must not be possible to modify an
existing code object).
On 10/15/07, Thomas Lee <[EMAIL PROTECTED]> wrote:
>
>
> Thomas Lee added the comment:
>
> Hack to make Python/codecs.c use Unicode strings internally. I recognize
> the way I have fixed it here is probably not ideal (basically ripped out
> PyString_*, replaced with a PyMem_Malloc/PyMem_Free call) but it fixes
> 10-12 tests that were failing with my earlier changes. If anybody can
> recommend a "nice" way to fix this, I'm all ears.
>
> The following still fail for me with this patch applied:
>
> -- test_compile
>
> This is due to PyString_*/PyUnicode_*/PyBytes_* confusion in the
> assembler struct (specifically: a_lnotab and a_bytecode) in
> Python/compile.c - tried replacing PyString_* calls with PyBytes_*
> calls, but this raises a TypeError because PyBytes is not hashable ...
> not sure what exactly is causing this.
>
> -- test_ctypes
> Looks like a simple case of ctypes using str8 instead of str. Appears to
> be an easy fix.
>
> -- test_modulefinder
> Failing because str8 >= str is now an invalid operation
>
> -- test_set
> This test needs some love.
>
> -- test_sqlite
> Not sure what's going on here.
>
> -- test_str
>
> This one is a little tricky: str8/str with __str__/__unicode__ ... how
> is this test supposed to behave with the fix in this patch?
>
> -- test_struct
> "unpack/pack not transitive" - what does that mean?
>
> -- test_subprocess
> Like modulefinder, this is probably just due to the use of str8 over str
> internally in the subprocess module. Likely to be an easy fix.
>
> The following tests fail for me irrespective of whether or not I have r4
> of my patch applied:
>
> -- test_doctest
> -- test_email
> -- test_nis
> -- test_pty
>
> If anybody can give this new patch a try and let me know the result it
> would be much appreciated.
>
> __________________________________
> Tracker <[EMAIL PROTECTED]>
> <http://bugs.python.org/issue1263>
> __________________________________
>
__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1263>
__________________________________
I'll look at this at some point. One quick comment: the lnotab and bytecode
should use PyString, which will be 'bytes' in 3.0a2. They must be
immutable because code objects must be immutable (it must not be possible to
modify an existing code object).
<br><br><div><span class="gmail_quote">On 10/15/07, <b
class="gmail_sendername">Thomas Lee</b> <<a href="mailto:[EMAIL
PROTECTED]">[EMAIL PROTECTED]</a>> wrote:</span><blockquote
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin:
0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Thomas Lee added the comment:<br><br>Hack to make Python/codecs.c use
Unicode strings internally. I recognize<br>the way I have fixed it here is
probably not ideal (basically ripped out<br>PyString_*, replaced with a
PyMem_Malloc/PyMem_Free call) but it fixes
<br>10-12 tests that were failing with my earlier changes. If anybody
can<br>recommend a "nice" way to fix this, I'm all
ears.<br><br>The following still fail for me with this patch applied:<br><br>--
test_compile
<br><br>This is due to PyString_*/PyUnicode_*/PyBytes_* confusion in
the<br>assembler struct (specifically: a_lnotab and a_bytecode)
in<br>Python/compile.c - tried replacing PyString_* calls with
PyBytes_*<br>calls, but this raises a TypeError because PyBytes is not hashable
...
<br>not sure what exactly is causing this.<br><br>-- test_ctypes<br>Looks like
a simple case of ctypes using str8 instead of str. Appears to<br>be an easy
fix.<br><br>-- test_modulefinder<br>Failing because str8 >= str is now an
invalid operation
<br><br>-- test_set<br>This test needs some love.<br><br>-- test_sqlite<br>Not
sure what's going on here.<br><br>-- test_str<br><br>This one is a little
tricky: str8/str with __str__/__unicode__ ... how<br>is this test supposed to
behave with the fix in this patch?
<br><br>-- test_struct<br>"unpack/pack not transitive" - what does
that mean?<br><br>-- test_subprocess<br>Like modulefinder, this is probably
just due to the use of str8 over str<br>internally in the subprocess module.
Likely to be an easy fix.
<br><br>The following tests fail for me irrespective of whether or not I have
r4<br>of my patch applied:<br><br>-- test_doctest<br>-- test_email<br>--
test_nis<br>-- test_pty<br><br>If anybody can give this new patch a try and let
me know the result it
<br>would be much
appreciated.<br><br>__________________________________<br>Tracker <<a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>><br><<a
href="http://bugs.python.org/issue1263">http://bugs.python.org/issue1263
</a>><br>__________________________________<br></blockquote></div><br><br
clear="all"><br>-- <br>--Guido van Rossum (home page: <a
href="http://www.python.org/~guido/">http://www.python.org/~guido/</a>)
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com