diff options
Diffstat (limited to 'Lib/tabnanny.py')
-rwxr-xr-x | Lib/tabnanny.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/tabnanny.py b/Lib/tabnanny.py index 0ae5e9f..3a8cd37 100755 --- a/Lib/tabnanny.py +++ b/Lib/tabnanny.py @@ -93,8 +93,11 @@ def check(file): check(fullname) return + with open(file, 'rb') as f: + encoding, lines = tokenize.detect_encoding(f.readline) + try: - f = open(file) + f = open(file, encoding=encoding) except IOError as msg: errprint("%r: I/O Error: %s" % (file, msg)) return |