Skip to content

Commit

Permalink
Finally fixes the CRLF issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
dietmarw committed Nov 9, 2014
1 parent 7cd62e8 commit 2e3d580
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
META = {
'name': 'ttws',
'url': 'https://github.com/dietmarw/trimtrailingwhitespaces',
'version': '0.6.2-dev',
'version': '0.6.2',
'description': 'Script to remove trailing whitespaces from textfiles.',
'classifiers': CLASSIFIERS,
'license': 'UNLICENSE',
Expand Down
4 changes: 2 additions & 2 deletions ttws/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def trimWhitespace(filepath, eol):
try:
with io.open(filepath, "r") as source:
lines = [line.rstrip() for line in source]
with io.open(filepath, "w", newline=eol) as target:
target.write(u''+eol.join(lines) + eol)
with io.open(filepath, "w", newline="") as target:
target.write(eol.join(lines) +eol)
except (UnicodeDecodeError, TypeError) as err:
print("\nOops! Failing to process file: %s\n"
"Are you sure it is of pure ASCII or UTF8 encoding?\n"
Expand Down

0 comments on commit 2e3d580

Please sign in to comment.