Jump to content
Sign in to follow this  
SpeedBall

AutoItX in Python - Unicode error?

Recommended Posts

SpeedBall

I'm just getting AutoIt/Python up and running, and my first real attempt to control anything results in a massive error. Can anyone make sense of this?

>>> Auto = win32com.client.Dispatch("AutoItX3.Control")

>>> Auto

<COMObject AutoItX3.Control>

>>> Auto.WinWaitActive("Untitled - Notepad")

Traceback (most recent call last):

File "<pyshell#6>", line 1, in <module>

Auto.WinWaitActive("Untitled - Notepad")

File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 454, in __getattr__

return self._make_method_(attr)

File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 295, in _make_method_

methodCodeList = self._olerepr_.MakeFuncMethod(self._olerepr_.mapFuncs[name], methodName,0)

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 297, in MakeFuncMethod

return self.MakeDispatchFuncMethod(entry, name, bMakeClass)

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 318, in MakeDispatchFuncMethod

s = linePrefix + 'def ' + name + '(self' + BuildCallList(fdesc, names, defNamedOptArg, defNamedNotOptArg, defUnnamedArg, defOutArg) + '):'

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 604, in BuildCallList

argName = MakePublicAttributeName(argName)

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 542, in MakePublicAttributeName

return filter( lambda char: char in valid_identifier_chars, className)

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 542, in <lambda>

return filter( lambda char: char in valid_identifier_chars, className)

UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 52: ordinal not in range(128)

Thanks.

Share this post


Link to post
Share on other sites
teodesian

I'm just getting AutoIt/Python up and running, and my first real attempt to control anything results in a massive error. Can anyone make sense of this?

>>> Auto = win32com.client.Dispatch("AutoItX3.Control")

>>> Auto

<COMObject AutoItX3.Control>

>>> Auto.WinWaitActive("Untitled - Notepad")

Traceback (most recent call last):

File "<pyshell#6>", line 1, in <module>

Auto.WinWaitActive("Untitled - Notepad")

File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 454, in __getattr__

return self._make_method_(attr)

File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 295, in _make_method_

methodCodeList = self._olerepr_.MakeFuncMethod(self._olerepr_.mapFuncs[name], methodName,0)

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 297, in MakeFuncMethod

return self.MakeDispatchFuncMethod(entry, name, bMakeClass)

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 318, in MakeDispatchFuncMethod

s = linePrefix + 'def ' + name + '(self' + BuildCallList(fdesc, names, defNamedOptArg, defNamedNotOptArg, defUnnamedArg, defOutArg) + '):'

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 604, in BuildCallList

argName = MakePublicAttributeName(argName)

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 542, in MakePublicAttributeName

return filter( lambda char: char in valid_identifier_chars, className)

File "C:\Python25\Lib\site-packages\win32com\client\build.py", line 542, in <lambda>

return filter( lambda char: char in valid_identifier_chars, className)

UnicodeDecodeError: 'ascii' codec can't decode byte 0x83 in position 52: ordinal not in range(128)

Thanks.

Try running the same thing in pythonwin. You'll notice that it will inexplicably run correctly. I don't know what kind of voodoo that pythonwin is doing that IDLE isn't but I sure as hell wish someone did, since there is nowhere (even the source code doesn't seem to help) as to what the hell is going on in there.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×