Skip to content
Snippets Groups Projects
Commit cb2faec3 authored by vvye's avatar vvye
Browse files

Fix bug in open function

parent 977dbc70
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ def detect_encoding_and_open(filename):
"""
raw_data = open(filename, 'rb').read()
detected_encoding = chardet.detect(raw_data)['encoding']
encodings = [detected_encoding['encoding'], 'utf-8', 'ansi']
encodings = [detected_encoding, 'utf-8', 'ansi']
for encoding in encodings:
f = open(filename, encoding=encoding)
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment