Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ python:
- "2.6"
- "2.7"
install:
- pip install -r requirements.txt --use-mirrors
- pip install -r requirements.txt
before_script:
- pip install -U -r test_requirements.txt --use-mirrors
- pip install -U -r test_requirements.txt
script:
- py.test --doctest-modules --pep8 rtkit -v --cov rtkit --cov-report term-missing
after_success:
- pip install python-coveralls --use-mirrors
- pip install python-coveralls
- coveralls
2 changes: 1 addition & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[pytest]
pep8ignore = E501
pep8ignore = E501 E402
5 changes: 2 additions & 3 deletions rtkit/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# for compatibility with Python 3.x
try:
from itertools import filterfalse as ifilterfalse
except ImportError:
Expand Down Expand Up @@ -109,7 +108,7 @@ def build(cls, body):
... a -- b
... '''
>>> RTParser.build(body)
[['# a\\nb', 'spam: 1', 'ham: 2,\\n3'], ['# c', 'spam: 4', 'ham:'], ['a -- b']]
[[u'# a\\nb', u'spam: 1', u'ham: 2,\\n3'], [u'# c', u'spam: 4', u'ham:'], [u'a -- b']]
"""
def build_section(section):
logic_lines = []
Expand All @@ -121,4 +120,4 @@ def build_section(section):
else:
logic_lines.append(line)
return logic_lines
return [build_section(b) for b in cls.SECTION.split(body.decode('utf-8'))]
return [build_section(b) for b in cls.SECTION.split(body.decode('utf-8', 'ignore'))]
2 changes: 1 addition & 1 deletion rtkit/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(self, request, response):
self.logger.info(request.get_method())
self.logger.info(request.get_full_url())
self.logger.debug('HTTP_STATUS: {0}'.format(self.status))
r = RTParser.HEADER.match(self.body.decode('utf-8'))
r = RTParser.HEADER.match(self.body.decode('utf-8', 'ignore'))
if r:
self.status = r.group('s').encode('utf-8')
self.status_int = int(r.group('i'))
Expand Down