Skip to content

Commit

Permalink
Fix bug in router with python2
Browse files Browse the repository at this point in the history
- 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: 5596379
  • Loading branch information
com4 committed Dec 15, 2017
1 parent 3cb1811 commit ad188fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion eventmq/utils/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ def recv_multipart(self):
msg = self.zsocket.recv_multipart()

# Decode bytes to strings in python3
if type(msg[0] in (bytes,)):
if sys.version[0] == '3' and type(msg[0] in (bytes,)):
msg = [m.decode() for m in msg]

# If it's not at least 4 frames long then most likely it isn't an
Expand Down

0 comments on commit ad188fd

Please sign in to comment.