[issue18873] "Encoding" detected in non-comment lines

Sergey Vishnikin report at bugs.python.org
Fri Sep 6 18:57:02 CEST 2013


Sergey Vishnikin added the comment:

-cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
+cookie_re = re.compile("#[^\r\n]*coding[:=]\s*([-\w.]+)")

Regex matches only if the encoding expression is preceded by a comment.

----------
keywords: +patch
nosy: +armicron
Added file: http://bugs.python.org/file31628/tokenizer.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18873>
_______________________________________


More information about the Python-bugs-list mailing list