write logfile as binary, use system packages when possible

pull/9/head
Raphaël Vinot 2016-05-09 18:56:30 +02:00
parent 2df076aaf9
commit 3efa57f0e2
2 changed files with 4 additions and 7 deletions

View File

@ -1,9 +1,9 @@
language: python language: python
python: python:
- "2.7" - "2.7_with_system_site_packages"
- "3.3" - "3.3"
- "3.4" - "3.4_with_system_site_packages"
- "3.5" - "3.5"
- "nightly" - "nightly"
@ -21,9 +21,6 @@ addons:
# Testing dependencies # Testing dependencies
- mercurial - mercurial
virtualenv:
system_site_packages: true
install: install:
- pip install -U pip - pip install -U pip
# General dependencies # General dependencies

View File

@ -159,7 +159,7 @@ class KittenGroomerBase(object):
def _computehash(self, path): def _computehash(self, path):
s = hashlib.sha1() s = hashlib.sha1()
with open(path, 'rb', errors='surrogateescape') as f: with open(path, 'rb') as f:
while True: while True:
buf = f.read(0x100000) buf = f.read(0x100000)
if not buf: if not buf:
@ -168,7 +168,7 @@ class KittenGroomerBase(object):
return s.hexdigest() return s.hexdigest()
def tree(self, base_dir, padding=' '): 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('#' * 80 + '\n')
lf.write('{}+- {}/\n'.format(padding, os.path.basename(os.path.abspath(base_dir)))) lf.write('{}+- {}/\n'.format(padding, os.path.basename(os.path.abspath(base_dir))))
padding += '| ' padding += '| '