diff -r 1a4e99460438 Lib/idlelib/ColorDelegator.py --- a/Lib/idlelib/ColorDelegator.py Thu May 31 09:17:29 2012 -0700 +++ b/Lib/idlelib/ColorDelegator.py Thu May 31 22:21:42 2012 -0500 @@ -20,10 +20,11 @@ # 1st 'file' colorized normal, 2nd as builtin, 3rd as string builtin = r"([^.'\"\\#]\b|^)" + any("BUILTIN", builtinlist) + r"\b" comment = any("COMMENT", [r"#[^\n]*"]) - sqstring = r"(\b[rRuU])?'[^'\\\n]*(\\.[^'\\\n]*)*'?" - dqstring = r'(\b[rRuU])?"[^"\\\n]*(\\.[^"\\\n]*)*"?' - sq3string = r"(\b[rRuU])?'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?" - dq3string = r'(\b[rRuU])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?' + stringprefix = r"(\br|u|ur|R|U|UR|Ur|uR|b|B|br|Br|bR|BR)?" + sqstring = stringprefix + r"'[^'\\\n]*(\\.[^'\\\n]*)*'?" + dqstring = stringprefix + r'"[^"\\\n]*(\\.[^"\\\n]*)*"?' + sq3string = stringprefix + r"'''[^'\\]*((\\.|'(?!''))[^'\\]*)*(''')?" + dq3string = stringprefix + r'"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?' string = any("STRING", [sq3string, dq3string, sqstring, dqstring]) return kw + "|" + builtin + "|" + comment + "|" + string +\ "|" + any("SYNC", [r"\n"]) diff -r 1a4e99460438 Misc/NEWS --- a/Misc/NEWS Thu May 31 09:17:29 2012 -0700 +++ b/Misc/NEWS Thu May 31 22:21:42 2012 -0500 @@ -67,6 +67,9 @@ Library ------- +- Issue #14958: Change IDLE systax highlighting to recognize all string and byte + literals supported in Python 2.7.4 (backported from 3.3). + - Issue #14962: Update text coloring in IDLE shell window after changing options. Patch by Roger Serwy.