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 <rep...@bugs.python.org> <http://bugs.python.org/issue18873> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com