Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3118,9 +3118,14 @@

def open_tsv(path):
try:
f = open(path, newline='', encoding='utf-8-sig')
f.read()
f.seek(0)
f = open(path, newline='', encoding='utf-8-sig')

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
Comment thread
yuanzhou marked this conversation as resolved.
Dismissed
try:
f.read()
f.seek(0)
return f
except UnicodeDecodeError:
f.close()
return open(path, newline='', encoding='utf-16')

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression

This path depends on a [user-provided value](1).
Comment thread
yuanzhou marked this conversation as resolved.
Dismissed
except UnicodeDecodeError:
return open(path, newline='', encoding='utf-16')

Expand Down
Loading