From e1c1f04368fda9eccbc2ea113054e1034453a728 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Fri, 27 Oct 2017 20:27:57 +0200 Subject: test_verify: Use io.open() instead of open() --- tests/test_verify.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_verify.py b/tests/test_verify.py index a9e7a5e..7217ccb 100644 --- a/tests/test_verify.py +++ b/tests/test_verify.py @@ -3,6 +3,7 @@ # (c) 2017 Michał Górny # Licensed under the terms of 2-clause BSD license +import io import os import os.path import socket @@ -533,7 +534,7 @@ class SymbolicLinkVerificationTest(NonEmptyFileVerificationTest): self.dir = tempfile.mkdtemp() self.real_path = os.path.join(self.dir, 'real') self.path = os.path.join(self.dir, 'symlink') - with open(self.real_path, 'wb') as f: + with io.open(self.real_path, 'wb') as f: f.write(TEST_STRING) os.symlink('real', self.path) @@ -581,7 +582,7 @@ class ProcFileVerificationTest(unittest.TestCase): def setUp(self): self.path = '/proc/version' try: - with open(self.path, 'rb') as f: + with io.open(self.path, 'rb') as f: data = f.read() st = os.fstat(f.fileno()) except: @@ -705,7 +706,7 @@ class UnreadableFileVerificationTest(unittest.TestCase): def setUp(self): self.dir = tempfile.mkdtemp() self.path = os.path.join(self.dir, 'test') - with open(self.path, 'w'): + with io.open(self.path, 'w'): pass os.chmod(self.path, 0) -- cgit v1.2.3