Skip to content

Commit

Permalink
Merge pull request #23 from dforsi/master
Browse files Browse the repository at this point in the history
Disable "universal newlines" to avoid unwanted changes
  • Loading branch information
lucasdemarchi committed Sep 3, 2014
2 parents 487673d + 1924531 commit 552e49f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def open_with_chardet(self, filename):
encoding = self.encdetector.result['encoding']

try:
f = open(filename, encoding=encoding)
f = open(filename, 'r', encoding=encoding, newline='')
lines = f.readlines()
except UnicodeDecodeError:
print('ERROR: Could not detect encoding: %s' % filename,
Expand All @@ -161,7 +161,7 @@ def open_with_internal(self, filename):

while True:
try:
f = open(filename, 'r', encoding=encodings[curr])
f = open(filename, 'r', encoding=encodings[curr], newline='')
lines = f.readlines()
break
except UnicodeDecodeError:
Expand Down

0 comments on commit 552e49f

Please sign in to comment.