-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix encoding detection and exception on empty files
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.
- Loading branch information
1 parent
bdcf7a6
commit 7d2bf45
Showing
2 changed files
with
26 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters