[New-bugs-announce] [issue7166] IDLE (python 3.1.1) syntax coloring for b'bytestring' and u'unicode' string literal

Lie Ryan report at bugs.python.org
Sun Oct 18 21:34:28 CEST 2009


New submission from Lie Ryan <lie.1296 at gmail.com>:

On python trunk and 3.2 IDLE, the b in b'' is not green colored.
On python 3.1 IDLE, the u in u'' is still colored, despite a SyntaxError.

(sorry, I don't have diff installed on my Windows machine)

Change on python trunk:
/Lib/idlelib/ColorDelegator.py
def make_pat():
    ....
    sqstring = r"(\b[rRuUbB])?'[^'\\\n]*(\\.[^'\\\n]*)*'?"
    dqstring = r'(\b[rRuUbB])?"[^"\\\n]*(\\.[^"\\\n]*)*"?'
    sq3string = r"(\b[rRuUbB])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
    dq3string = r'(\b[rRuUbB])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
    ....


And on py3k branch:
/Lib/idlelib/ColorDelegator.py
def make_pat():
    ....
    sqstring = r"(\b[rRbB])?'[^'\\\n]*(\\.[^'\\\n]*)*'?"
    dqstring = r'(\b[rRbB])?"[^"\\\n]*(\\.[^"\\\n]*)*"?'
    sq3string = r"(\b[rRbB])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?"
    dq3string = r'(\b[rRbB])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
    ....

----------
components: IDLE
messages: 94222
nosy: lieryan
severity: normal
status: open
title: IDLE (python 3.1.1) syntax coloring for b'bytestring' and u'unicode' string literal
type: behavior
versions: Python 3.1

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


More information about the New-bugs-announce mailing list