[X2Go-Commits] [python-x2go] 01/01: Various I/O + Unicode fixes for various write() calls.
git-admin at x2go.org
git-admin at x2go.org
Tue Sep 26 13:15:51 CEST 2017
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch master
in repository python-x2go.
commit 1ae15909d468d8d2bc6a1ee3bf9d47f09a26cc56
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date: Tue Sep 26 13:15:47 2017 +0200
Various I/O + Unicode fixes for various write() calls.
---
x2go/backends/control/plain.py | 2 +-
x2go/backends/proxy/nx3.py | 2 +-
x2go/backends/terminal/plain.py | 8 ++++----
x2go/log.py | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/x2go/backends/control/plain.py b/x2go/backends/control/plain.py
index 3091af9..89cd7b8 100644
--- a/x2go/backends/control/plain.py
+++ b/x2go/backends/control/plain.py
@@ -474,7 +474,7 @@ class X2GoControlSession(paramiko.SSHClient):
if self.session_died:
self.logger("control session seams to be dead, not executing command ,,%s'' on X2Go server %s" % (_rerewrite_blanks(cmd), self.profile_name,), loglevel=loglevel)
- return (io.StringIO(), io.StringIO(), io.StringIO('failed to execute command'))
+ return (io.StringIO(), io.StringIO(), io.StringIO(u'failed to execute command'))
self._transport_lock.acquire()
diff --git a/x2go/backends/proxy/nx3.py b/x2go/backends/proxy/nx3.py
index 89714ea..b531824 100644
--- a/x2go/backends/proxy/nx3.py
+++ b/x2go/backends/proxy/nx3.py
@@ -118,7 +118,7 @@ class X2GoProxy(base.X2GoProxy):
if _X2GOCLIENT_OS == "Windows":
_options_filename = os.path.join(self.session_info.local_container, 'options')
options = open(_options_filename, 'w')
- options.write('%s:%s' % (','.join(self.PROXY_OPTIONS), self.PROXY_DISPLAY))
+ options.write(u'%s:%s' % (','.join(self.PROXY_OPTIONS), self.PROXY_DISPLAY))
options.close()
self.PROXY_OPTIONS= [ 'nx/nx', 'options=%s' % os.path.join("\\", "..", "S-%s" % self.session_info.name, 'options'), ]
diff --git a/x2go/backends/terminal/plain.py b/x2go/backends/terminal/plain.py
index 09ea853..5726fca 100644
--- a/x2go/backends/terminal/plain.py
+++ b/x2go/backends/terminal/plain.py
@@ -866,11 +866,11 @@ class X2GoTerminalSession(object):
_tmp_io_object = io.StringIO()
_auth_rsakey.write_private_key(_tmp_io_object)
- _tmp_io_object.write('----BEGIN RSA IDENTITY----')
- _tmp_io_object.write('%s %s' % (_host_rsakey.get_name(),_host_rsakey.get_base64(),))
+ _tmp_io_object.write(u'----BEGIN RSA IDENTITY----')
+ _tmp_io_object.write(u'%s %s' % (_host_rsakey.get_name(),_host_rsakey.get_base64(),))
# _x2go_key_fname must be a UniX path
- _x2go_key_fname = '%s/%s/%s' % (os.path.dirname(self.session_info.remote_container), 'ssh', 'key.z%s' % self.session_info.agent_pid)
+ _x2go_key_fname = u'%s/%s/%s' % (os.path.dirname(self.session_info.remote_container), 'ssh', 'key.z%s' % self.session_info.agent_pid)
_x2go_key_bundle = _tmp_io_object.getvalue()
# if there is another call to this method currently being processed, wait for that one to finish
@@ -1117,7 +1117,7 @@ class X2GoTerminalSession(object):
_id = self.session_window.id
else:
_id = self.session_window
- f.write('ID:{window_id}\n'.format(window_id=_id))
+ f.write(u'ID:{window_id}\n'.format(window_id=_id))
f.close()
self.logger('Updating session.window file %s: Window-ID->%s' % (session_window_file, _id), loglevel=log.loglevel_DEBUG)
else:
diff --git a/x2go/log.py b/x2go/log.py
index 6de9ded..e29e75a 100644
--- a/x2go/log.py
+++ b/x2go/log.py
@@ -102,9 +102,9 @@ class X2GoLogger(object):
msg = msg.encode(utils.get_encoding())
if self.tag is not None:
- self.destination.write('%s[%s] (%s) %s: %s\n' % (self.name, self.progpid, tag, self._loglevel_NAMES[loglevel].upper(), msg.decode()))
+ self.destination.write(u'%s[%s] (%s) %s: %s\n' % (self.name, self.progpid, tag, self._loglevel_NAMES[loglevel].upper(), msg.decode()))
else:
- self.destination.write('%s[%s] %s: %s\n' % (self.name, self.progpid, self._loglevel_NAMES[loglevel].upper(), msg.decode()))
+ self.destination.write(u'%s[%s] %s: %s\n' % (self.name, self.progpid, self._loglevel_NAMES[loglevel].upper(), msg.decode()))
__call__ = message
def get_loglevel(self):
--
Alioth's /srv/git/code.x2go.org/python-x2go.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/python-x2go.git
More information about the x2go-commits
mailing list