diff --git a/MayaSublime.py b/MayaSublime.py index 5073e68..71a3011 100644 --- a/MayaSublime.py +++ b/MayaSublime.py @@ -351,6 +351,12 @@ def _MayaSublime_streamScriptEditor(enable, host="127.0.0.1", port=5123, quiet=F buf = StringIO() + def _enc(s): + try: + return s.encode('utf-8') + except AttributeError: + return s + def _streamToMayaSublime(msg, msgType, *args): buf.seek(0) buf.truncate() @@ -395,7 +401,7 @@ def _streamToMayaSublime(msg, msgType, *args): return try: - _MayaSublime_SOCK.sendto(_py_str(part), (host, port)) + _MayaSublime_SOCK.sendto(_enc(part), (host, port)) except Exception as e: if e.errno == errno.EMSGSIZE: diff --git a/messages.json b/messages.json index cce9039..6479075 100644 --- a/messages.json +++ b/messages.json @@ -11,5 +11,6 @@ "3.0.4": "messages/3.0.4.md", "3.1.0": "messages/3.1.0.md", "3.1.1": "messages/3.1.1.md", - "3.1.2": "messages/3.1.2.md" + "3.1.2": "messages/3.1.2.md", + "3.1.3": "messages/3.1.3.md" } diff --git a/messages/3.1.3.md b/messages/3.1.3.md new file mode 100644 index 0000000..3d9a246 --- /dev/null +++ b/messages/3.1.3.md @@ -0,0 +1,3 @@ +MayaSublime 3.1.3 change log: + +- [#41]: Fix crash with "receive_maya_output" feature enabled in Maya 2022 (python3)