Mailing List Archive

[issue2860] re module fails to handle digits in byte strings
New submission from Stefan Behnel <scoder@users.sourceforge.net>:

The following fails in Py3.0a5:

>>> import re
>>> re.search(b'(\d+)', b'-2.80 98\n')

I get a TypeError: "Can't convert 'int' object to str implicitly" in
line 204 of file "sre_parse.py", code being "char = char + c".

----------
components: Library (Lib)
messages: 66848
nosy: scoder
severity: normal
status: open
title: re module fails to handle digits in byte strings
type: behavior
versions: Python 3.0

__________________________________
Tracker <report@bugs.python.org>
<http://bugs.python.org/issue2860>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue2860] re module fails to handle digits in byte strings [ In reply to ]
Benjamin Peterson <musiccomposition@gmail.com> added the comment:

I think it's debatable whether re should byte strings since it is
searching through text and not raw binary data. However, this may be a
case of practicality over purity.

----------
nosy: +benjamin.peterson

__________________________________
Tracker <report@bugs.python.org>
<http://bugs.python.org/issue2860>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com