commit | 6d297cbec48e9026ddf31d2ff95df7c182572dc9 | [log] [tgz] |
---|---|---|
author | Serhiy Storchaka <storchaka@gmail.com> | Sun Mar 20 23:36:29 2016 +0200 |
committer | Serhiy Storchaka <storchaka@gmail.com> | Sun Mar 20 23:36:29 2016 +0200 |
tree | 77e0dd82cbcfa6c48fffeeb24f6c31ec62510bfa | |
parent | cac1d236a24e2755c05103d485a3b42a884b5a45 [diff] [blame] |
Issue #26581: Use the first coding cookie on a line, not the last one.
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 @@ 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):