This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository python-x2go.

commit b879f7a2e5599fbfc33724d464dbd9e25622c3dd
Author: Mike Gabriel <mike.gabr...@das-netzwerkteam.de>
Date:   Mon Dec 2 16:32:18 2019 +0100

    Fix writing of inifiles when running under Python3.
---
 debian/changelog | 4 +++-
 x2go/inifiles.py | 8 ++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b31ac2f..60d07c2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 python-x2go (0.6.1.2-0x2go1) UNRELEASED; urgency=medium
 
-  * Continue development
+  [ Mike Gabriel ]
+  * New upstream version (0.6.1.2):
+    - Fix writing of inifiles when running under Python3.
 
  -- X2Go Release Manager <git-ad...@x2go.org>  Fri, 22 Nov 2019 08:19:40 +0100
 
diff --git a/x2go/inifiles.py b/x2go/inifiles.py
index f19ed9d..c4158de 100644
--- a/x2go/inifiles.py
+++ b/x2go/inifiles.py
@@ -35,6 +35,7 @@ __name__    = 'x2go.inifiles'
 
 # modules
 import os
+import sys
 try:
     import configparser
 except:
@@ -218,13 +219,16 @@ class X2GoIniFile(object):
         """
         if self.user_config_file and self._write_user_config:
             try:
-                fd = open(self.user_config_file, 'wb')
+                if sys.version_info[0] >= 3:
+                    fd = open(self.user_config_file.encode(), 'w')
+                else:
+                    fd = open(self.user_config_file.encode(), 'wb')
                 self.iniConfig.write(fd)
                 fd.close()
                 self._write_user_config = False
                 return True
             except Exception as e:
-                print(e)
+                self.logger('failure during write operation of %s; reported 
error: %s' % (self.user_config_file, e), loglevel=log.loglevel_ERROR, )
         return False
     __write = write
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on 
/srv/git/code.x2go.org/python-x2go.git
_______________________________________________
x2go-commits mailing list
x2go-commits@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-commits

Reply via email to