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.

Author kaizhu
Recipients kaizhu
Date 2009-07-18.01:40:52
SpamBayes Score 0.00015841317
Marked as misclassified No
Message-id <1247881254.19.0.244856948962.issue6509@psf.upfronthosting.co.za>
In-reply-to
Content
traced culprit to sre_parse.py <line 711> (where literal is always str):

...
def parse_template(source, pattern):
    # parse 're' replacement string into list of literals and
    # group references
    s = Tokenizer(source)
    sget = s.get
    p = []
    a = p.append
    def literal(literal, p=p, pappend=a):
        if p and p[-1][0] is LITERAL:
            p[-1] = LITERAL, p[-1][1] + literal
        else:
            pappend((LITERAL, literal))
...

a possible hack-around is <line 717>:

...
    a = p.append
    def literal(literal, p=p, pappend=a):
        if isinstance(source, (bytes, bytearray)): # hack
            literal = literal.encode()             # hack str->bytes
        if p and p[-1][0] is LITERAL:
...
History
Date User Action Args
2009-07-18 01:40:54kaizhusetrecipients: + kaizhu
2009-07-18 01:40:54kaizhusetmessageid: <1247881254.19.0.244856948962.issue6509@psf.upfronthosting.co.za>
2009-07-18 01:40:53kaizhulinkissue6509 messages
2009-07-18 01:40:52kaizhucreate