-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
4 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
|
||
__version__ = '0.2.40' | ||
__version__ = '0.2.41' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ def read_csv(input_file_name): | |
sniffer = csv.Sniffer() | ||
try: | ||
# AWS Organization returns a CSV with a BOM (byte order mark) character = U+FEFF to specify encoding | ||
first_character = open(input_file_name).read(1) | ||
first_character = open(input_file_name, errors='ignore').read(1) | ||
Check warning Code scanning / CodeGuru Reviewer Scanner Resource leak Medium
**Problem*
This line of code might contain a resource leak. Resource leaks can cause your system to slow down or crash. **Fix* Consider closing the resource returned by the following method call: *open*. The resource is allocated by call *builtins.open*. Currently, there are execution paths that do not contain closure statements, for example, when *hasNext (in method read\_nonblank\_lines)()* throws an exception. To prevent this resource leak, close the object returned by *open()* in a try-finally block or declare it using a with statement. **More info** View details about the with statement in the Python developer's guide (external link). |
||
encoding = 'utf-8-sig' if first_character == '\ufeff' else 'utf-8' | ||
|
||
with open(input_file_name, encoding=encoding, errors='ignore') as file_: | ||
|