From fcbabc0ce929d91f63098bba4867d102ac04ead0 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Wed, 19 Apr 2017 08:50:06 +0200 Subject: Python 3 support and Travis testing Fix Python 3 support for pkispawn: Config values are text values. Therefore the config file has to be written as text file. Test Python 3 support in Travis CI. The little script py3rewrite copies pki.server Python files and rewrites pkispawn and pkidestroy to use Python 3. Change-Id: Ia516f80df94cacc2acfa70929ad16bb5b9c39ddf Signed-off-by: Christian Heimes --- base/server/python/pki/server/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'base/server/python') diff --git a/base/server/python/pki/server/__init__.py b/base/server/python/pki/server/__init__.py index 88986548d..46c6711ed 100644 --- a/base/server/python/pki/server/__init__.py +++ b/base/server/python/pki/server/__init__.py @@ -296,9 +296,9 @@ class PKISubsystem(object): def save(self): sorted_config = sorted(self.config.items(), key=operator.itemgetter(0)) - with io.open(self.cs_conf, 'wb') as f: + with io.open(self.cs_conf, 'w') as f: for (key, value) in sorted_config: - f.write('%s=%s\n' % (key, value)) + f.write(u'%s=%s\n' % (key, value)) def is_valid(self): return os.path.exists(self.conf_dir) -- cgit