New submission from kai zhu <kaizhu...@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 <rep...@bugs.python.org>
<http://bugs.python.org/issue6509>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to