[Python-3000] raw strings and \u

Neal Norwitz nnorwitz at gmail.com
Sat Apr 5 19:58:02 CEST 2008


On Sat, Apr 5, 2008 at 8:03 AM, Benjamin Peterson
<musiccomposition at gmail.com> wrote:
> On Sat, Apr 5, 2008 at 10:00 AM, Guido van Rossum <guido at python.org> wrote:
> > :-)
> >
> > So did the broken version make it into the 3.0a4 release, or did you
> > break it after the release?
> >
> Missed it by 7 revisions! I'm going to add a test for that, though, so it
> doesn't happen again.

Are there more tests for raw strings that should be added?  When I
looked in the C code it looked there were were several things going on
IIRC.  It seems we ought to have a fairly comprehensive set of tests
for raw strings (among other things) to verify we always do the right
thing in the future.

Thanks,
n

>
>
> >
> >
> > On Sat, Apr 5, 2008 at 7:59 AM, Benjamin Peterson
> >
> >
> >
> > <musiccomposition at gmail.com> wrote:
> > >
> > >
> > > On Sat, Apr 5, 2008 at 9:58 AM, Guido van Rossum <guido at python.org>
> wrote:
> > > > Thanks -- that was quick!
> > > Well, I was the guilty party...
> > >
> > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Sat, Apr 5, 2008 at 7:50 AM, Benjamin Peterson
> > > > <musiccomposition at gmail.com> wrote:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On Sat, Apr 5, 2008 at 9:44 AM, Guido van Rossum <guido at python.org>
> > > wrote:
> > > > > >
> > > > > > On Fri, Apr 4, 2008 at 11:18 PM, Neal Norwitz <nnorwitz at gmail.com>
> > > wrote:
> > > > > > > I just checked in r62163 with this change:
> > > > > > >  -            rc = os.system(r"ml64 -c -Foms\uptable.obj
> > > > > ms\uptable.asm")
> > > > > > >  +            rc = os.system("ml64 -c -Foms\\uptable.obj
> > > > > ms\\uptable.asm")
> > > > > > >
> > > > > > >  What should happen with raw unicode strings that contain a \u?
> The
> > > > > > >  old code above was generating:
> > > > > > >   SyntaxError: (unicode error) truncated \uXXXX
> > > > > > >
> > > > > > >  Is that correct?  Or should the \u be translated literally?
> > > > > >
> > > > > > Oops, there's a regression!!!
> > > > > >
> > > > > > In 2.x, \uDDDD and \UDDDDDDDD are interpreted as Unicode escapes
> in
> > > > > > raw Unicode strings. That was a mistake, but we can't fix it
> (except
> > > > > > when using "from __future__ import unicode_literals"). In 3.0, \u
> or
> > > > > > \U in a raw string should have no special meaning -- it's just a
> > > > > > backslash followed by 'u' or 'U'.
> > > > > >
> > > > > > This was fixed in 3.0a3. It seems to have reverted to the old
> (2.x)
> > > > > > behavior in 3.0a4.
> > > > > >
> > > > > > THIS MUST BE FIXED!
> > > > > Done in r62165.
> > > > > >
> > > > > >
> > > > > > --
> > > > > >
> > > > > > --Guido van Rossum (home page: http://www.python.org/~guido/)
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > _______________________________________________
> > > > > > Python-3000 mailing list
> > > > > > Python-3000 at python.org
> > > > > > http://mail.python.org/mailman/listinfo/python-3000
> > > > > >
> > > > > > Unsubscribe:
> > > > >
> > >
> http://mail.python.org/mailman/options/python-3000/musiccomposition%40gmail.com
> > > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Cheers,
> > > > > Benjamin Peterson
> > > >
> > > >
> > > >
> > > > --
> > > >
> > > >
> > > >
> > > > --Guido van Rossum (home page: http://www.python.org/~guido/)
> > > >
> > >
> > >
> > >
> > > --
> > > Cheers,
> > > Benjamin Peterson
> >
> >
> >
> > --
> >
> >
> >
> > --Guido van Rossum (home page: http://www.python.org/~guido/)
> >
>
>
>
> --
> Cheers,
> Benjamin Peterson


More information about the Python-3000 mailing list