From 3efa57f0e24324904524d10b3fcdfc6ae84fff93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 9 May 2016 18:56:30 +0200 Subject: [PATCH] write logfile as binary, use system packages when possible --- .travis.yml | 7 ++----- kittengroomer/helpers.py | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index af98a40..6102777 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: python python: - - "2.7" + - "2.7_with_system_site_packages" - "3.3" - - "3.4" + - "3.4_with_system_site_packages" - "3.5" - "nightly" @@ -21,9 +21,6 @@ addons: # Testing dependencies - mercurial -virtualenv: - system_site_packages: true - install: - pip install -U pip # General dependencies diff --git a/kittengroomer/helpers.py b/kittengroomer/helpers.py index 32f5113..02df41b 100644 --- a/kittengroomer/helpers.py +++ b/kittengroomer/helpers.py @@ -159,7 +159,7 @@ class KittenGroomerBase(object): def _computehash(self, path): s = hashlib.sha1() - with open(path, 'rb', errors='surrogateescape') as f: + with open(path, 'rb') as f: while True: buf = f.read(0x100000) if not buf: @@ -168,7 +168,7 @@ class KittenGroomerBase(object): return s.hexdigest() def tree(self, base_dir, padding=' '): - with open(self.log_content, 'a', errors='surrogateescape') as lf: + with open(self.log_content, 'ab') as lf: lf.write('#' * 80 + '\n') lf.write('{}+- {}/\n'.format(padding, os.path.basename(os.path.abspath(base_dir)))) padding += '| '