[Python-3000] setup.py fails in the py3k-struni branch
Ron Adam
rrr at ronadam.com
Sun Jun 17 04:38:12 CEST 2007
Guido van Rossum wrote:
> On 6/13/07, Ron Adam <rrr at ronadam.com> wrote:
>> Attached both the str8 repr as s"..." and s'...', and the latest
>> no_raw_escape patch which I think is complete now and should apply
>> with no
>> problems.
>
> I like the str8 repr patch enough to check it in.
>
>> I tracked the random fails I am having in test_tokenize.py down to it
>> doing
>> a round trip on random test_*.py files. If one of those files has a
>> problem it causes test_tokanize.py to fail also. So I added a line to
>> the
>> test to output the file name it does the round trip on so those can be
>> fixed as they are found.
>>
>> Let me know it needs to be adjusted or something doesn't look right.
>
> Well, I'm still philosophically uneasy with r'\' being a valid string
> literal, for various reasons (one being that writing a string parser
> becomes harder and harder). I definitely want r'\u1234' to be a
> 6-character string, however. Do you have a patch that does just that?
> (We can argue over the rest later in a larger forum.)
The str8 patch caused tokanize.py to fail again also. ;-) Those s'' == ''
asserts of course.
I tracked it down to cStringIO.c only returning str8 types. Fixing that
*may* fix a number of other modules as well, but I'm not sure how, so I put
a str() around the returned value in tokanize.py with a note for now.
The attached path has various minor fix's. (But not the no raw escape
stuff yet.)
Cheers,
Ron
tokenize.py - Get rid of s'' errors by making returned value from
cStringIO.c to unicode with str().
test_tokanize.py - Added printing of roundtrip file names to test. This is
needed because files are a random sample and if they have errors, it causes
this module to fail. Without this there is no way to tell what is going on.
_fileio.c - Return unicode strings instead of str8 strings. (check this one.)
smtplib - Fixed strip() without args on bytes.
test_fileinput.py - Replaced bad writelines() call with a for loop with a
write() call. (buffer object doesn't have a writelines method, and
try-finally hid the error.)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: variousfixes.diff
Type: text/x-patch
Size: 3447 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-3000/attachments/20070616/acfc33d9/attachment.bin
More information about the Python-3000
mailing list