[issue6509] re.py - <compiled byte-object regular expr> encounter unexpected str-object

kai zhu report at bugs.python.org
Sat Jul 18 02:27:26 CEST 2009


New submission from kai zhu <kaizhu256 at gmail.com>:

>>> import re
>>> compiled = re.compile(b"a(\w)")
>>> s = b"aa"
>>> s = compiled.sub(b"a\\1", s)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../lib/python3.1/re.py", line 303, in filter
    return sre_parse.expand_template(template, match)
  File ".../lib/python3.1/sre_parse.py", line 810, in expand_template
    return sep.join(literals)
TypeError: sequence item 0: expected bytes, str found

----------
components: Library (Lib)
messages: 90650
nosy: kaizhu
severity: normal
status: open
title: re.py - <compiled byte-object regular expr> encounter unexpected str-object
type: behavior
versions: Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6509>
_______________________________________


More information about the Python-bugs-list mailing list