Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

encoding detection #37

Merged
merged 1 commit into from Apr 25, 2012
Jump to file or symbol
Failed to load files and symbols.
+6 −1
Split
View
@@ -78,7 +78,7 @@ def lookup_module(filename):
# stolen from Python 3.1's tokenize.py, by Ka-Ping Yee
import re
-cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
+cookie_re = re.compile("^\s*#.*coding[:=]\s*([-\w.]+)")
from codecs import lookup, BOM_UTF8
def detect_encoding(readline):
View
@@ -0,0 +1,5 @@
+def f(encoding=None):
+ print 'ENCODING:', encoding
+
+from pudb import runcall
+runcall(f)