re.sub() bug?
holger krekel
pyth at devel.trillke.net
Fri Nov 8 04:25:53 EST 2002
More information about the Python-list mailing list
Fri Nov 8 04:25:53 EST 2002
- Previous message (by thread): re.sub() bug?
- Next message (by thread): re.sub() bug?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Mike Brown wrote:
> Python 2.2.1 on FreeBSD.
> These work as expected:
>
> >>> re.sub(u'f', u'b', u'foo') # keep string as Unicode
> u'boo'
> >>> re.sub(u'f', u'b', 'foo') # coerce string to Unicode
> u'boo'
>
> But this doesn't work the way I'd think it would:
>
> >>> re.sub(u'f', u'b', u'') # coerce string to non-Unicode?!
> ''
>
> So, is this a bug?
I think so. File a bug report at sourceforge.
holger
- Previous message (by thread): re.sub() bug?
- Next message (by thread): re.sub() bug?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list