[ python-Bugs-1182603 ] re.escape(s) prints wrong for chr(0)

SourceForge.net noreply at sourceforge.net
Fri Apr 15 04:23:13 CEST 2005


Bugs item #1182603, was opened at 2005-04-13 22:54
Message generated for change (Comment added) made by nascheme
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1182603&group_id=5470

Category: Python Library
Group: Python 2.4
>Status: Closed
>Resolution: Invalid
Priority: 5
Submitted By: Nick Jacobson (nickjacobson)
Assigned to: Nobody/Anonymous (nobody)
Summary: re.escape(s) prints wrong for chr(0)

Initial Comment:
>>> import re
>>> s = chr(0)
>>> s
'\x00'
>>> re.escape(s)
'\000'




I believe it should print:
'\\x00'


----------------------------------------------------------------------

>Comment By: Neil Schemenauer (nascheme)
Date: 2005-04-15 02:23

Message:
Logged In: YES 
user_id=35752

'\000' is a valid pattern to match the null character.  I
don't think there is any bug here.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1182603&group_id=5470


More information about the Python-bugs-list mailing list