Skip to content
Unverified Commit 900f1865 authored by Dimitri Papadopoulos Orfanos's avatar Dimitri Papadopoulos Orfanos Committed by GitHub
Browse files

Fix encoding detection and exception on empty files (#2195)

The encoding detection code was trying to catch encoding-related
exceptions when the file is opened. This doesn't make sense, because
at this point no data has been read, therefore no encoding errors can be
detected. Instead, catch encoding-related exceptions when the file
contents are read.

Also avoid bailing out with `Exception('Unknown encoding')` on empty
files.
parent ad644529
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment