Default to UTF-8 encoding in open() calls

This commit is contained in:
Anthony Sottile 2017-04-19 08:11:57 -07:00
parent 1be4e4f82e
commit e272c219fd
8 changed files with 26 additions and 18 deletions

View file

@ -1,11 +1,11 @@
from __future__ import unicode_literals
import contextlib
import io
import os.path
import shutil
import tarfile
from pre_commit import util
from pre_commit.envcontext import envcontext
from pre_commit.envcontext import Var
from pre_commit.languages import helpers
@ -65,7 +65,7 @@ def _install_rbenv(
tf.extractall(repo_cmd_runner.path(directory, 'plugins'))
activate_path = repo_cmd_runner.path(directory, 'bin', 'activate')
with io.open(activate_path, 'w') as activate_file:
with util.open(activate_path, 'w') as activate_file:
# This is similar to how you would install rbenv to your home directory
# However we do a couple things to make the executables exposed and
# configure it to work in our directory.