Skip to content

Commit

Permalink
Properly handle already encoded topics
Browse files Browse the repository at this point in the history
  • Loading branch information
nanomad committed Jan 21, 2024
1 parent 0d2026b commit a0c079a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.idea
gmqtt.egg-info
dist/

build/
# virtualenvs
env/
venv/
Expand Down
2 changes: 1 addition & 1 deletion gmqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

class Message:
def __init__(self, topic, payload, qos=0, retain=False, **kwargs):
self.topic = topic.encode('utf-8', errors='replace') if isinstance(topic, str) else str
self.topic = topic.encode('utf-8', errors='replace') if isinstance(topic, str) else topic
self.qos = qos
self.retain = retain
self.dup = False
Expand Down

0 comments on commit a0c079a

Please sign in to comment.