summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-10-20 18:14:14 +0200
committerTomas Babej <tbabej@redhat.com>2015-10-27 17:23:25 +0100
commitacf519f5c5e02578efe6e9c3e1816654e0f23e95 (patch)
treed6b2e78311d45148a3652ded8a208cdd47ca1082 /ipatests
parent6811b4be6ae462526a1c6bec222e939045879ba1 (diff)
downloadfreeipa-acf519f5c5e02578efe6e9c3e1816654e0f23e95.tar.gz
freeipa-acf519f5c5e02578efe6e9c3e1816654e0f23e95.tar.xz
freeipa-acf519f5c5e02578efe6e9c3e1816654e0f23e95.zip
ipapython.secrets: Port to Python 3
StringIO was renamed in Python 3. The import was was unused, so remove it. Files need to be opened in binary mode if bytes are written to them. (For Python 2: on Linux, there's no practical difference between text and binary mode) Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_ipapython/test_secrets.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipatests/test_ipapython/test_secrets.py b/ipatests/test_ipapython/test_secrets.py
index d88659e6f..9fbf825d2 100644
--- a/ipatests/test_ipapython/test_secrets.py
+++ b/ipatests/test_ipapython/test_secrets.py
@@ -31,7 +31,7 @@ class TestiSecStore(unittest.TestCase):
cls.cert2db = os.path.join(testdir, 'cert2db')
os.mkdir(cls.cert2db)
seedfile = os.path.join(testdir, 'seedfile')
- with open(seedfile, 'w') as f:
+ with open(seedfile, 'wb') as f:
seed = os.urandom(1024)
f.write(seed)
subprocess.call(['certutil', '-d', cls.certdb, '-N', '-f', pwfile])