##// END OF EJS Templates
minor py3 fixes in IPython.parallel...
MinRK -
Show More
@@ -55,7 +55,7 b' from IPython.parallel.controller.hub import HubFactory'
55 55 from IPython.parallel.controller.scheduler import TaskScheduler,launch_scheduler
56 56 from IPython.parallel.controller.sqlitedb import SQLiteDB
57 57
58 from IPython.parallel.util import signal_children, split_url, asbytes, disambiguate_url
58 from IPython.parallel.util import signal_children, split_url, disambiguate_url
59 59
60 60 # conditional import of MongoDB backend class
61 61
@@ -224,7 +224,9 b' class IPControllerApp(BaseParallelApplication):'
224 224 self.log.info("loading connection info from %s", fname)
225 225 with open(fname) as f:
226 226 cfg = json.loads(f.read())
227 key = c.Session.key = asbytes(cfg['exec_key'])
227 key = cfg['exec_key']
228 # json gives unicode, Session.key wants bytes
229 c.Session.key = key.encode('ascii')
228 230 xport,addr = cfg['url'].split('://')
229 231 c.HubFactory.engine_transport = xport
230 232 ip,ports = addr.split(':')
@@ -653,7 +653,7 b' class Hub(SessionFactory):'
653 653 return
654 654 record = init_record(msg)
655 655
656 record['client_uuid'] = client_id
656 record['client_uuid'] = client_id.decode('ascii')
657 657 record['queue'] = 'task'
658 658 header = msg['header']
659 659 msg_id = header['msg_id']
@@ -27,7 +27,7 b' from IPython.external.ssh import tunnel'
27 27 from IPython.utils.traitlets import (
28 28 Instance, Dict, Integer, Type, CFloat, Unicode, CBytes, Bool
29 29 )
30 # from IPython.utils.localinterfaces import LOCALHOST
30 from IPython.utils import py3compat
31 31
32 32 from IPython.parallel.controller.heartmonitor import Heart
33 33 from IPython.parallel.factory import RegistrationFactory
@@ -192,12 +192,12 b' class EngineFactory(RegistrationFactory):'
192 192 # # Redirect input streams and set a display hook.
193 193 if self.out_stream_factory:
194 194 sys.stdout = self.out_stream_factory(self.session, iopub_stream, u'stdout')
195 sys.stdout.topic = 'engine.%i.stdout'%self.id
195 sys.stdout.topic = py3compat.cast_bytes('engine.%i.stdout' % self.id)
196 196 sys.stderr = self.out_stream_factory(self.session, iopub_stream, u'stderr')
197 sys.stderr.topic = 'engine.%i.stderr'%self.id
197 sys.stderr.topic = py3compat.cast_bytes('engine.%i.stderr' % self.id)
198 198 if self.display_hook_factory:
199 199 sys.displayhook = self.display_hook_factory(self.session, iopub_stream)
200 sys.displayhook.topic = 'engine.%i.pyout'%self.id
200 sys.displayhook.topic = py3compat.cast_bytes('engine.%i.pyout' % self.id)
201 201
202 202 self.kernel = Kernel(config=self.config, int_id=self.id, ident=self.ident, session=self.session,
203 203 control_stream=control_stream, shell_streams=shell_streams, iopub_stream=iopub_stream,
@@ -24,6 +24,8 b' from StringIO import StringIO'
24 24 import zmq
25 25 from nose import SkipTest
26 26
27 from IPython.testing import decorators as dec
28
27 29 from IPython import parallel as pmod
28 30 from IPython.parallel import error
29 31 from IPython.parallel import AsyncResult, AsyncHubResult, AsyncMapResult
@@ -298,6 +300,7 b' class TestView(ClusterTestCase):'
298 300 self.assertFalse(view.block)
299 301 self.assertTrue(view.block)
300 302
303 @dec.known_failure_py3
301 304 def test_importer(self):
302 305 view = self.client[-1]
303 306 view.clear(block=True)
@@ -330,7 +333,7 b' class TestView(ClusterTestCase):'
330 333 sys.stdout = sio
331 334 # just 'print a' worst ~99% of the time, but this ensures that
332 335 # the stdout message has arrived when the result is finished:
333 ip.magic_px('import sys,time;print a; sys.stdout.flush();time.sleep(0.2)')
336 ip.magic_px('import sys,time;print (a); sys.stdout.flush();time.sleep(0.2)')
334 337 sys.stdout = savestdout
335 338 buf = sio.getvalue()
336 339 self.assertTrue('[stdout:' in buf, buf)
General Comments 0
You need to be logged in to leave comments. Login now