summaryrefslogtreecommitdiff
path: root/test/utils.py
diff options
context:
space:
mode:
authorJulien Cristau <julien.cristau@logilab.fr>2013-06-18 15:49:08 +0200
committerJulien Cristau <julien.cristau@logilab.fr>2013-06-18 15:49:08 +0200
commit525550e9f4321d02a16cd5900bb2e1c3b597269e (patch)
treed7b52340d738cbc2229dde3425e87c013224c193 /test/utils.py
parentc6ba5d0384a36961a8c9b59ab706d76f3c148263 (diff)
downloadpylint-git-525550e9f4321d02a16cd5900bb2e1c3b597269e.tar.gz
test/utils: use codecs.open instead of plain open for python3 compat
We don't really care about the encoding here, just want something that won't explode on non-ascii.
Diffstat (limited to 'test/utils.py')
-rw-r--r--test/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/utils.py b/test/utils.py
index 6722e3292..34e1d4449 100644
--- a/test/utils.py
+++ b/test/utils.py
@@ -4,6 +4,7 @@
import os
import sys
from os.path import join, dirname, abspath
+import codecs
from logilab.common.testlib import TestCase
from astroid import MANAGER
@@ -14,7 +15,8 @@ def _astroid_wrapper(func, modname):
def _sorted_file(path):
- lines = [line.strip() for line in open(path).readlines()
+ # we don't care about the actual encoding, but python3 forces us to pick one
+ lines = [line.strip() for line in codecs.open(path, encoding='latin1').readlines()
if (line.find('squeleton generated by ') == -1 and
not line.startswith('__revision__ = "$Id:'))]
lines = [line for line in lines if line]