diff --git a/.travis.yml b/.travis.yml index 856530b..77b07c8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/pytest.ini b/pytest.ini index 927590e..ded72d5 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,2 +1,2 @@ [pytest] -pep8ignore = E501 +pep8ignore = E501 E402 diff --git a/rtkit/parser.py b/rtkit/parser.py index 4193550..c6dba6a 100644 --- a/rtkit/parser.py +++ b/rtkit/parser.py @@ -1,4 +1,3 @@ -# for compatibility with Python 3.x try: from itertools import filterfalse as ifilterfalse except ImportError: @@ -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 = [] @@ -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'))] diff --git a/rtkit/resource.py b/rtkit/resource.py index 75aa3cc..540c9c9 100644 --- a/rtkit/resource.py +++ b/rtkit/resource.py @@ -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'))