Skip to content
This repository has been archived by the owner on Aug 9, 2023. It is now read-only.

Commit

Permalink
Adds fix for windows line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
sudorandom committed Feb 16, 2014
1 parent 32ebf30 commit a11d532
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion evepaste/utils.py
Expand Up @@ -15,7 +15,7 @@ def split_and_strip(s):
"""
# Strip each line
lines = [line.strip(' ').replace(u"\xa0", u"").replace(u"\xc2", u"")
for line in s.strip(' ').split('\n')]
for line in s.strip(' ').replace("\r\n", "\n").split('\n')]
# Return non-empty lines
return [line for line in lines if line]

Expand Down
3 changes: 3 additions & 0 deletions tests/parsers/parse.py
Expand Up @@ -13,4 +13,7 @@
\t\t\t\t\t\t\t\t\t\t''', ('cargo_scan',
[{'name': 'rifter', 'quantity': 10}],
['\t\t\t\t\t\t\t\t\t\t']))
PARSE_TABLE.add_test('10 rifter\r\n',
('cargo_scan',
[{'name': 'rifter', 'quantity': 10}], []))
PARSE_TABLE.add_test('', Unparsable)

0 comments on commit a11d532

Please sign in to comment.