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.

classification
Title: IDLE (python 3.1.1) syntax coloring for b'bytestring' and u'unicode' string literal
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: ezio.melotti, lieryan, taleinat
Priority: normal Keywords: easy

Created on 2009-10-18 19:34 by lieryan, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg94222 - (view) Author: Lie Ryan (lieryan) Date: 2009-10-18 19:34
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])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
    ....
msg107187 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-06-06 06:25
Duplicate of #8641.
History
Date User Action Args
2022-04-11 14:56:54adminsetgithub: 51415
2010-06-06 07:17:04taleinatsetnosy: + taleinat
2010-06-06 06:25:33ezio.melottisetstatus: open -> closed
resolution: duplicate
messages: + msg107187

stage: resolved
2009-10-19 02:51:27ezio.melottisetpriority: normal
nosy: + ezio.melotti
keywords: + easy
2009-10-18 19:34:46lieryansetversions: + Python 2.7, Python 3.2, - Python 3.1
2009-10-18 19:34:27lieryancreate