Skip to content

Commit

Permalink
Fix crash in Maya 2022 (py3) with "receive_maya_output" enabled (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinfx committed Sep 30, 2021
1 parent fda023f commit 6b7cd30
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion MayaSublime.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
3 changes: 3 additions & 0 deletions messages/3.1.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MayaSublime 3.1.3 change log:

- [#41]: Fix crash with "receive_maya_output" feature enabled in Maya 2022 (python3)

0 comments on commit 6b7cd30

Please sign in to comment.