summaryrefslogtreecommitdiffstats
path: root/Lib/py_compile.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2007-11-08 16:34:32 (GMT)
committerChristian Heimes <christian@cheimes.de>2007-11-08 16:34:32 (GMT)
commit8bd14fb398b1b89c82defdac6c5755c9ca86859b (patch)
tree6b0c944665e76f33d32bd40c7676693c7556a2a6 /Lib/py_compile.py
parent1a13d597093422d666e0efa3d6d51f8a507b5317 (diff)
downloadcpython-8bd14fb398b1b89c82defdac6c5755c9ca86859b.zip
cpython-8bd14fb398b1b89c82defdac6c5755c9ca86859b.tar.gz
cpython-8bd14fb398b1b89c82defdac6c5755c9ca86859b.tar.bz2
Fixed #1403 where compileall and py_compile choked on an encoding header in a py file. Both modules need more unit tests.
Diffstat (limited to 'Lib/py_compile.py')
-rw-r--r--Lib/py_compile.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/py_compile.py b/Lib/py_compile.py
index f7a2002..912972b 100644
--- a/Lib/py_compile.py
+++ b/Lib/py_compile.py
@@ -88,7 +88,7 @@ def read_encoding(file, default):
break
m = re.match(r".*\bcoding:\s*(\S+)\b", line)
if m:
- return str(m.group(1))
+ return m.group(1).decode("ascii")
return default
finally:
f.close()