Fixed #1403 where compileall and py_compile choked on an encoding header in a py file. Both modules need more unit tests.

This commit is contained in:
Christian Heimes 2007-11-08 16:34:32 +00:00
parent 1a13d59709
commit 8bd14fb398
2 changed files with 4 additions and 1 deletions

View file

@ -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()