diff --git a/IPython/parallel/apps/ipcontrollerapp.py b/IPython/parallel/apps/ipcontrollerapp.py index 5f26e17..3b18e7a 100755 --- a/IPython/parallel/apps/ipcontrollerapp.py +++ b/IPython/parallel/apps/ipcontrollerapp.py @@ -197,7 +197,7 @@ class IPControllerApp(BaseParallelApplication): location = socket.gethostbyname_ex(socket.gethostname())[2][-1] cdict['location'] = location fname = os.path.join(self.profile_dir.security_dir, fname) - with open(fname, 'w') as f: + with open(fname, 'wb') as f: f.write(json.dumps(cdict, indent=2)) os.chmod(fname, stat.S_IRUSR|stat.S_IWUSR) diff --git a/IPython/parallel/controller/hub.py b/IPython/parallel/controller/hub.py index 01ab1eb..ab41713 100755 --- a/IPython/parallel/controller/hub.py +++ b/IPython/parallel/controller/hub.py @@ -250,7 +250,7 @@ class HubFactory(RegistrationFactory): # monitor socket sub = ctx.socket(zmq.SUB) - sub.setsockopt(zmq.SUBSCRIBE, "") + sub.setsockopt(zmq.SUBSCRIBE, b"") sub.bind(self.monitor_url) sub.bind('inproc://monitor') sub = ZMQStream(sub, loop) diff --git a/IPython/parallel/controller/scheduler.py b/IPython/parallel/controller/scheduler.py index c49f9c7..b318f39 100644 --- a/IPython/parallel/controller/scheduler.py +++ b/IPython/parallel/controller/scheduler.py @@ -678,7 +678,7 @@ def launch_scheduler(in_addr, out_addr, mon_addr, not_addr, config=None, mons = zmqstream.ZMQStream(ctx.socket(zmq.PUB),loop) mons.connect(mon_addr) nots = zmqstream.ZMQStream(ctx.socket(zmq.SUB),loop) - nots.setsockopt(zmq.SUBSCRIBE, '') + nots.setsockopt(zmq.SUBSCRIBE, b'') nots.connect(not_addr) # setup logging. diff --git a/IPython/utils/tests/test_traitlets.py b/IPython/utils/tests/test_traitlets.py index 7e4ee49..5639a50 100755 --- a/IPython/utils/tests/test_traitlets.py +++ b/IPython/utils/tests/test_traitlets.py @@ -704,15 +704,15 @@ class TestComplex(TraitTestBase): class BytesTrait(HasTraits): - value = Bytes('string') + value = Bytes(b'string') class TestBytes(TraitTestBase): obj = BytesTrait() - _default_value = 'string' - _good_values = ['10', '-10', '10L', - '-10L', '10.1', '-10.1', 'string'] + _default_value = b'string' + _good_values = [b'10', b'-10', b'10L', + b'-10L', b'10.1', b'-10.1', b'string'] _bad_values = [10, -10, 10L, -10L, 10.1, -10.1, 1j, [10], ['ten'],{'ten': 10},(10,), None, u'string'] diff --git a/IPython/zmq/session.py b/IPython/zmq/session.py index f4482e3..e2001a2 100644 --- a/IPython/zmq/session.py +++ b/IPython/zmq/session.py @@ -82,7 +82,7 @@ default_packer = json_packer default_unpacker = json_unpacker -DELIM="" +DELIM=b"" #----------------------------------------------------------------------------- # Classes