Skip to content

Commit 6adf04d

Browse files
committed
Remove forced use of pickle protocol version 2 (issue #115)
Both microscope.client and microscope.deviceserver modules set Pyro to use pickle with its protocol version 2. This was done in b9e5c1c to support both Python 2 and 3 (pickle's protocol version 2 is the highest supported in Python 2). However, we now require Python>=3.5 which can handle up to protocol version 4. Higher protocol versions are desirable because they bring performance improvements with support for more native data types. We could set Pyro.config.PICKLE_PROTOCOL_VERSION to version 4. This helps users when client and server are in different Python versions. However, this forces others to use older protocol versions. Instead, the onus should be on users that need something different from the default. This can be easily done on the device server config file.
1 parent 8f2d2fd commit 6adf04d

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

microscope/clients.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
# Pyro configuration. Use pickle because it can serialize numpy ndarrays.
2929
Pyro4.config.SERIALIZERS_ACCEPTED.add('pickle')
3030
Pyro4.config.SERIALIZER = 'pickle'
31-
Pyro4.config.PICKLE_PROTOCOL_VERSION = 2
3231

3332
LISTENERS = {}
3433

microscope/deviceserver.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
# Pyro configuration. Use pickle because it can serialize numpy ndarrays.
4646
Pyro4.config.SERIALIZERS_ACCEPTED.add('pickle')
4747
Pyro4.config.SERIALIZER = 'pickle'
48-
Pyro4.config.PICKLE_PROTOCOL_VERSION = 2
4948

5049
## We effectively expose all attributes of the classes since our
5150
## devices don't hold any private data. The private methods are to

0 commit comments

Comments
 (0)