
report at bugs
Sep 9, 2007, 11:37 PM
Post #1 of 14
(383 views)
Permalink
|
|
[issue1140] re.sub returns str when processing empty unicode string
|
|
New submission from Beda Kosata: While re.sub normally returns unicode strings when processing unicode, it returns a normal string when dealing with an empty unicode string. Example: >>> print type( re.sub( "XX", "", u"")) <type 'str'> >>> print type( re.sub( "XX", "", u"A")) <type 'unicode'> This inconsistency could lead to annoying bugs (at least it did for me :) ---------- components: Regular Expressions messages: 55775 nosy: beda severity: minor status: open title: re.sub returns str when processing empty unicode string type: behavior versions: Python 2.4, Python 2.5 __________________________________ Tracker <report[at]bugs.python.org> <http://bugs.python.org/issue1140> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
|