summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-03-20 21:36:29 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-03-20 21:36:29 (GMT)
commit6d297cbec48e9026ddf31d2ff95df7c182572dc9 (patch)
tree77e0dd82cbcfa6c48fffeeb24f6c31ec62510bfa /Lib/idlelib
parentcac1d236a24e2755c05103d485a3b42a884b5a45 (diff)
downloadcpython-6d297cbec48e9026ddf31d2ff95df7c182572dc9.zip
cpython-6d297cbec48e9026ddf31d2ff95df7c182572dc9.tar.gz
cpython-6d297cbec48e9026ddf31d2ff95df7c182572dc9.tar.bz2
Issue #26581: Use the first coding cookie on a line, not the last one.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/IOBinding.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index ef40715..1233d80 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -65,7 +65,7 @@ else:
encoding = encoding.lower()
-coding_re = re.compile(r'^[ \t\f]*#.*coding[:=][ \t]*([-\w.]+)')
+coding_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)')
blank_re = re.compile(r'^[ \t\f]*(?:[#\r\n]|$)')
class EncodingMessage(SimpleDialog):