diff options
| author | jason | 2017-12-15 14:31:30 -0700 |
|---|---|---|
| committer | jason | 2017-12-15 14:31:30 -0700 |
| commit | ad188fde7110b49d3397dc7641e5f215f2cc8635 (patch) | |
| tree | e85e32cef5a401b7297f19b75d7475188745fcbe | |
| parent | 3cb1811253e8d2a396e04986d93749b2bd47df8a (diff) | |
| download | eventmq-ad188fde7110b49d3397dc7641e5f215f2cc8635.tar.gz eventmq-ad188fde7110b49d3397dc7641e5f215f2cc8635.zip | |
Fix bug in router with python2
- This code seems to have been added awhile ago, but never really
tested in python 2. We shouldn't convert strings to unicode in
python 2 when receiving messages. This causes a TypeError when
forwarding messages:
```
TypeError: Frame 0 (u'719ff6da-ac33-4273-a2bc-6cb9b4...) does not
support the buffer interface.
```
References: 55963796809ce5aacf47c24d8295ab5b1a500ad1
| -rw-r--r-- | eventmq/utils/classes.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/eventmq/utils/classes.py b/eventmq/utils/classes.py index 1148da3..eb431bd 100644 --- a/eventmq/utils/classes.py +++ b/eventmq/utils/classes.py | |||
| @@ -362,7 +362,7 @@ class ZMQReceiveMixin(object): | |||
| 362 | msg = self.zsocket.recv_multipart() | 362 | msg = self.zsocket.recv_multipart() |
| 363 | 363 | ||
| 364 | # Decode bytes to strings in python3 | 364 | # Decode bytes to strings in python3 |
| 365 | if type(msg[0] in (bytes,)): | 365 | if sys.version[0] == '3' and type(msg[0] in (bytes,)): |
| 366 | msg = [m.decode() for m in msg] | 366 | msg = [m.decode() for m in msg] |
| 367 | 367 | ||
| 368 | # If it's not at least 4 frames long then most likely it isn't an | 368 | # If it's not at least 4 frames long then most likely it isn't an |