Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re.escape(s) prints wrong for chr(0) #41854

Closed
nickjacobson mannequin opened this issue Apr 13, 2005 · 2 comments
Closed

re.escape(s) prints wrong for chr(0) #41854

nickjacobson mannequin opened this issue Apr 13, 2005 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@nickjacobson
Copy link
Mannequin

nickjacobson mannequin commented Apr 13, 2005

BPO 1182603
Nosy @nascheme

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2005-04-15.02:23:12.000>
created_at = <Date 2005-04-13.22:54:54.000>
labels = ['invalid', 'library']
title = 're.escape(s) prints wrong for chr(0)'
updated_at = <Date 2005-04-15.02:23:12.000>
user = 'https://bugs.python.org/nickjacobson'

bugs.python.org fields:

activity = <Date 2005-04-15.02:23:12.000>
actor = 'nascheme'
assignee = 'none'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2005-04-13.22:54:54.000>
creator = 'nickjacobson'
dependencies = []
files = []
hgrepos = []
issue_num = 1182603
keywords = []
message_count = 2.0
messages = ['25007', '25008']
nosy_count = 2.0
nosy_names = ['nascheme', 'nickjacobson']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1182603'
versions = ['Python 2.4']

@nickjacobson
Copy link
Mannequin Author

nickjacobson mannequin commented Apr 13, 2005

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

I believe it should print:
'\\\x00'

@nickjacobson nickjacobson mannequin closed this as completed Apr 13, 2005
@nickjacobson nickjacobson mannequin added invalid stdlib Python modules in the Lib dir labels Apr 13, 2005
@nickjacobson nickjacobson mannequin closed this as completed Apr 13, 2005
@nickjacobson nickjacobson mannequin added invalid stdlib Python modules in the Lib dir labels Apr 13, 2005
@nascheme
Copy link
Member

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant