Permalink
Browse files

Adds fix for windows line endings

  • Loading branch information...
1 parent 32ebf30 commit a11d53244d72248792c4ebc5481777397e3c6f64 @sudorandom sudorandom committed Feb 16, 2014
Showing with 4 additions and 1 deletion.
  1. +1 −1 evepaste/utils.py
  2. +3 −0 tests/parsers/parse.py
View
@@ -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]
View
@@ -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.