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.

classification
Title: re.escape(s) prints wrong for chr(0)
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: nascheme, nickjacobson
Priority: normal Keywords:

Created on 2005-04-13 22:54 by nickjacobson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg25007 - (view) Author: Nick Jacobson (nickjacobson) Date: 2005-04-13 22:54
>>> import re
>>> s = chr(0)
>>> s
'\x00'
>>> re.escape(s)
'\\000'




I believe it should print:
'\\\x00'
msg25008 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2005-04-15 02:23
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.
History
Date User Action Args
2022-04-11 14:56:10adminsetgithub: 41854
2005-04-13 22:54:54nickjacobsoncreate