Issue #15809: IDLE shell now uses locale encoding instead of Latin1 for
decoding unicode literals.
diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py
index 6ffc1b9..d023e28 100644
--- a/Lib/idlelib/run.py
+++ b/Lib/idlelib/run.py
@@ -210,6 +210,8 @@
fn, ln, nm, line = tb[i]
if nm == '?':
nm = "-toplevel-"
+ if fn.startswith("<pyshell#") and IOBinding.encoding != 'utf-8':
+ ln -= 1 # correction for coding cookie
if not line and fn.startswith("<pyshell#"):
line = rpchandler.remotecall('linecache', 'getline',
(fn, ln), {})