Commit 1613ed81 authored by Benjamin Peterson's avatar Benjamin Peterson

fix for files with coding cookies and BOMs

parent 689a5580
...@@ -333,9 +333,11 @@ def detect_encoding(readline): ...@@ -333,9 +333,11 @@ def detect_encoding(readline):
# This behaviour mimics the Python interpreter # This behaviour mimics the Python interpreter
raise SyntaxError("unknown encoding: " + encoding) raise SyntaxError("unknown encoding: " + encoding)
if bom_found and codec.name != 'utf-8': if bom_found:
# This behaviour mimics the Python interpreter if codec.name != 'utf-8':
raise SyntaxError('encoding problem: utf-8') # This behaviour mimics the Python interpreter
raise SyntaxError('encoding problem: utf-8')
encoding += '-sig'
return encoding return encoding
first = read_or_stop() first = read_or_stop()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment