This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author beda
Recipients beda
Date 2007-09-10.06:37:17
SpamBayes Score 0.015955357
Marked as misclassified No
Message-id <1189406238.99.0.778554736734.issue1140@psf.upfronthosting.co.za>
In-reply-to
Content
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 :)
History
Date User Action Args
2007-09-10 06:37:19bedasetspambayes_score: 0.0159554 -> 0.015955357
recipients: + beda
2007-09-10 06:37:19bedasetspambayes_score: 0.0159554 -> 0.0159554
messageid: <1189406238.99.0.778554736734.issue1140@psf.upfronthosting.co.za>
2007-09-10 06:37:18bedalinkissue1140 messages
2007-09-10 06:37:18bedacreate