You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
migrated from Bugzilla #486185
status UNCONFIRMED severity normal in component MQTT-Python for 1.2
Reported in version 1.1 on platform All
Assigned to: Roger Light
On 2016-01-20 11:12:07 -0500, Andreas Koehler wrote:
The documentation suggests using struct.pack() to create payloads.
But invoking e.g. client.publish("test",struct.pack('>d',1.2345)) results in an error:
File "D:\Miniconda3\envs\python34\lib\site-packages\paho\mqtt\client.py", line 871, in publish
raise TypeError('payload must be a string, bytearray, int, float or None.')
This is because client.publish only checks isinstance(payload, bytearray), but not isinstance(payload, bytes), which is what struct.pack returns on Python 3
Easy fix in client.py on line 864: for sys.version_info[0]==3 use isinstance(payload, bytes) instead of isinstance(payload, unicode)
Workaround: use bytearray(struct.pack(...)) to create payload.
On 2016-01-20 11:18:54 -0500, Andreas Koehler wrote:
Regarding the fix - it's not only line 864... there are more type checks on the payload later on...
The text was updated successfully, but these errors were encountered:
This commit is the result of squashing several intermediate commits.
The individual commit messages were as follows:
Commit message eclipse-paho#1
-----------------
Roll back changes from commit 4910b78.
The commit referenced above removed uses of `socket.error`,
preferring instead to use the Python 3 builtin error types.
This causes various subtle issues with Python 2.7.
In this "revert", I have opted to have the compatibility
`BlockingIOError` be defined as a subclass of IOError, rather than
simply a name alias, because at least within this file, at least,
all uses where we need to check for it. Since `socket.error` is a
subclass of IOError, making `BlockingIOError` a name alias would make
the code more confusing, since it may not be obvious to the reader that
this is the case.
Commit message eclipse-paho#2
-----------------
Bump __version__ to reflect Digi patches have been applied
Commit message eclipse-paho#3
-----------------
Add _on_pre_connect default value of None
Otherwise a client using `.connect_async` will error out.
Commit message eclipse-paho#4
-----------------
Catch and handle socket.error on reconnect calls
Commit message eclipse-paho#5
-----------------
Use select.poll instead of select.select
select.select only works if the fileno values of the given objects
are <1024. In an application that uses or creates hundreds of file
descriptors, one can very easily end up in a situation where the socket
file descriptor is beyond that.
A typical Linux system will have the open file limit for the user set
to 1024, so this generally doesn't happen. But with this change in
place, Paho will function correctly if it does.
migrated from Bugzilla #486185
status UNCONFIRMED severity normal in component MQTT-Python for 1.2
Reported in version 1.1 on platform All
Assigned to: Roger Light
On 2016-01-20 11:12:07 -0500, Andreas Koehler wrote:
On 2016-01-20 11:18:54 -0500, Andreas Koehler wrote:
The text was updated successfully, but these errors were encountered: