enthought / enthought/comtypes
UnicodeDecodeError:
- Dominant language
- Python
- Stars
- 345
- Forks
- 105
- PR merge metrics
- No merged PRs in 30d
Description
I try
Autodesk MAYA 2008 windows operate from IE 7.0 use comtypes "CreateObject".
ex.
Click "openImageFile"
1. IE (Maya.CommandEngine.MEL)
2. MAYA (melCommand "python")
3. comtypes ( CreateObject("Photoshop.Application") )
open imageFile on PhotoShop.
```
1.------ test.html ------
test
<!--
Dim MEL
Set MEL = CreateObject("Maya.CommandEngine.MEL")
MEL.Connect()
//-->
2.------ nh_execPyTest.mel ------
global proc nh_execPyTest(){
python("nh_openPSD2()");
}
3. ------ nh_openPSD2.py ------
from comtypes.client import CreateObject
def nh_openPSD2():
try:
psApp = CreateObject("Photoshop.Application")
docRef = psApp.Open()
except Exception, x:
print x
====== ERROR ======
# Traceback (most recent call last):
# File "", line 1, in
# File "C:\Documents and Settings\hatori\My Documents\maya\7.0\scripts\opt\et1.py", line 32, in nh_openPSD2
# psApp = CreateObject("Photoshop.Application")
# File "C:\Python25\Lib\site-packages\comtypes\client\__init__.py", line 197, in CreateObject
# obj = comtypes.CoCreateInstance(clsid, clsctx=clsctx, interface=interface)
# File "C:\Python25\Lib\site-packages\comtypes\__init__.py", line 1119, in CoCreateInstance
# _ole32.CoCreateInstance(byref(clsid), punkouter, clsctx, byref(iid), byref(p))
# File "..\Modules\_ctypes\callproc.c", line 754, in GetResult
# WindowsError: (-2147417843, '\x83A\x83v\x83......') #
...... is
UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 20: ordinal not in range(128)
=====================
```
--- sitecustomize.py ---
import sys
sys.setdefaultencoding('utf-8')
and win32com
http://techarttiki.blogspot.com/2008/08/photoshop-scripting-with-python.html
was error.
nh_execPyTest.mel and nh_openPSD2.py is operating.
Could advice be got?
Contributor guide
Assessment
This issue has not been assessed yet.