Commit da27efbb authored by murban's avatar murban
Browse files

Set python hardcoded on version 2

parent 510d999e
......@@ -155,7 +155,7 @@ class LocalConnectionImpl(object):
_local_connection_feeder = None
def __init__(self, command, **kwargs):
if command[0] == "python" and not sys.platform.startswith("java"):
if command[0] == "python2" and not sys.platform.startswith("java"):
command[0] = sys.executable
logger.info("local connection: %s" % " ".join(command))
self.__proc = subprocess.Popen(command, stdin=subprocess.PIPE,
......@@ -285,7 +285,7 @@ class SSHConnectionImpl(object):
else:
if missing_host_key_policy != "reject":
import warnings
warnings.warn("Unknown missing host key policy: " +
warnings.warn("Unknown missing host key policy: " +
missing_host_key_policy)
self.__client.set_missing_host_key_policy(
paramiko.RejectPolicy())
......@@ -451,7 +451,7 @@ class Connection(object):
self.__userid = userid
self.__workspaceid = workspaceid
self.__host = host
self.__python = kwargs.get('python', 'python') or "python"
self.__python = kwargs.get('python', 'python2') or "python2"
self.__username = kwargs.get('username', None)
self.__server = None
self.__tempdir = kwargs.get("tempdir", "")
......@@ -482,16 +482,16 @@ class Connection(object):
MAGIC_STRING = "START_RPYC".encode("ascii")
MAGIC_STRING_LENGTH = len(MAGIC_STRING)
buf = b''
while True:
# fill buffer to needed size
remaining = MAGIC_STRING_LENGTH - len(buf)
buf += self._connection.stdout.read(remaining)
# compare
if buf == MAGIC_STRING:
return
# jump to next S
try:
buf = buf[buf.index(MAGIC_STRING[0], 1):]
......@@ -694,7 +694,7 @@ class Connection(object):
def rpyc(self):
return self.__rpyc
def errors(self):
for i, line in enumerate(self._connection.stderr):
line = line.rstrip()
......@@ -761,7 +761,7 @@ class ConnectionPool(object):
key = (user.id, workspace.id)
if key in self._connections and self._connections[key].active():
logger.debug(
"workspace already conected: %d - %d" %
"workspace already conected: %d - %d" %
(user.id, workspace.id))
self._connections[key].send_status()
return self._connections[key]
......@@ -791,7 +791,7 @@ class ConnectionPool(object):
def clear(self, user=None, workspace=None):
uid = user.id if type(user) == User else user
wid = workspace.id if type(workspace) == Workspace else workspace
for _uid, _wid in self._connections.keys():
for _uid, _wid in self._connections.keys():
if uid and uid != _uid:
continue
if wid and wid != _wid:
......@@ -803,7 +803,7 @@ class ConnectionPool(object):
c = self._connections[key]
del self._connections[key]
c.close()
return
# not found, send topic anyway
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment