Thanks for the patches! Applied, except for the change to tokenize.py; instead, I changed test_tokenize.py to use io.StringIO.
--Guido On 6/16/07, Ron Adam <[EMAIL PROTECTED]> wrote: > > > Guido van Rossum wrote: > > On 6/13/07, Ron Adam <[EMAIL PROTECTED]> 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.) > > > -- --Guido van Rossum (home page: http://www.python.org/~guido/) _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
