Skip to content

Commit 6b7cd30

Browse files
committed
Fix crash in Maya 2022 (py3) with "receive_maya_output" enabled (#41)
1 parent fda023f commit 6b7cd30

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

MayaSublime.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,12 @@ def _MayaSublime_streamScriptEditor(enable, host="127.0.0.1", port=5123, quiet=F
351351
352352
buf = StringIO()
353353
354+
def _enc(s):
355+
try:
356+
return s.encode('utf-8')
357+
except AttributeError:
358+
return s
359+
354360
def _streamToMayaSublime(msg, msgType, *args):
355361
buf.seek(0)
356362
buf.truncate()
@@ -395,7 +401,7 @@ def _streamToMayaSublime(msg, msgType, *args):
395401
return
396402
397403
try:
398-
_MayaSublime_SOCK.sendto(_py_str(part), (host, port))
404+
_MayaSublime_SOCK.sendto(_enc(part), (host, port))
399405
400406
except Exception as e:
401407
if e.errno == errno.EMSGSIZE:

messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"3.0.4": "messages/3.0.4.md",
1212
"3.1.0": "messages/3.1.0.md",
1313
"3.1.1": "messages/3.1.1.md",
14-
"3.1.2": "messages/3.1.2.md"
14+
"3.1.2": "messages/3.1.2.md",
15+
"3.1.3": "messages/3.1.3.md"
1516
}

messages/3.1.3.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MayaSublime 3.1.3 change log:
2+
3+
- [#41]: Fix crash with "receive_maya_output" feature enabled in Maya 2022 (python3)

0 commit comments

Comments
 (0)