#461 Cannot register active scripting with pyscript.py

closed-works-for-me
nobody
com (105)
5
2012-01-28
2009-12-24
Anonymous
No

Using Windows 7 Ultimate, I am having trouble installing active scripting for Python 3.1. I'm talking about the following installers:

python-3.1.1.msi
pywin32-214.win32-py3.1.exe

On WXP, it would usually install active scripting fine from the get-go, but I knew from experience that failed sometimes, which it did now. So I went to C:\Python31\Lib\site-packages\win32comext\axscript\client and ran pyscript.py. Whereas in the past, that would work, I get very colourful errors.

First one dialog that is littered with random characters that seem like chinese right after displaying the 'Requesting elevation and retrying...' line, once even a full page of that corrupted junk. Example:

'[Window Title]
㩃坜湩潤獷獜獹整㍭尲浣⹤硥e†ɛ础䫁湥耀ɂ洨ɂ欠ɂ쥨ɂ槠ɂ즸ɂ죈ɂ棈ɂ硋䫁睯耀ɂ辀ɂ輰ɂ쩘ɂ計ɂ뱠ɂ歯湥⠠⁡硎䫁汰耀 ɂ쭈ɂ苘ɂ莠ɂ쯨ɂ衸ɂ걨Ɂ靐Ɂ硑䫁杮耀%ɂ蟘ɂ蠀ɂ챠ɂ諸ɂ軠ɂ鿨ḟ雠Ɂ硔䫁漠耀*?痨?и?欰Ḝ畂汩偤瑡彨牟敶⹲硟䫁琊耀/ḟ锐Ɂ铠Ɂ钀Ɂ鑰ɁꮐɁꯀɁ隰Ɂ硢䫁敭耀4ḟ鿨ḟ需Ɂ鿨ḟ鿨ḟ陀Ɂ鿨ḟ靀Ɂ硥䫁⹳耀9ḟ鿨ḟ꤈Ɂ隐Ɂ鿨ḟ隀Ɂ鿨ḟ霰Ɂ硨䫁桴耀>久佃䥄䝎琠歯湥眊楨档琠汥獬礠畯硳䫁档耀C摯湩⁧慷⁳獵摥琠敤潣敤琠敨戠硶䫁猠耀H⹭᩵

[Content]
Windows cannot find '㩃坜湩潤獷獜獹整㍭尲浣⹤硥e†ɛ础䫁湥耀ɂ洨ɂ欠ɂ쥨ɂ槠ɂ즸ɂ죈ɂ棈ɂ硋䫁睯耀ɂ辀ɂ輰ɂ쩘ɂ計ɂ뱠ɂ歯湥⠠⁡硎䫁汰耀 ɂ쭈ɂ苘ɂ莠ɂ쯨ɂ衸ɂ걨Ɂ靐Ɂ硑䫁杮耀%ɂ蟘ɂ蠀ɂ챠ɂ諸ɂ軠ɂ鿨ḟ雠Ɂ硔䫁漠耀*?痨?и?欰Ḝ畂汩偤瑡彨牟敶⹲硟䫁琊耀/ḟ锐Ɂ铠Ɂ钀Ɂ鑰ɁꮐɁꯀɁ隰Ɂ硢䫁敭耀4ḟ鿨ḟ需Ɂ鿨ḟ鿨ḟ陀Ɂ鿨ḟ靀Ɂ硥䫁⹳耀9ḟ鿨ḟ꤈Ɂ隐Ɂ鿨ḟ隀Ɂ鿨ḟ霰Ɂ硨䫁桴耀>久佃䥄䝎琠歯湥眊楨档琠汥獬礠畯硳䫁档耀C摯湩⁧慷⁳獵摥琠敤潣敤琠敨戠硶䫁猠耀H⹭᩵'. Make sure you typed the name correctly, and then try again.

[OK]

This makes me think buffer overrun or some codepage/encoding issues.

After that I get an ordinary stacktrace:

Requesting elevation and retrying...
Failed to remove tempfile 'c:\users\me\appdata\local\temp\tmpx2_leopycomserverreg.out': [Error 2] The system cannot find the file specified: 'c:\\users\\me\\appdata\\local\\temp\\tmpx2_leopycomserverreg.out'
Traceback (most recent call last):
File "C:\Python31\lib\site-packages\win32com\server\register.py", line 566, in UseCommandLine
RegisterClasses(*classes, **flags)
File "C:\Python31\lib\site-packages\win32com\server\register.py", line 421, in RegisterClasses
addPyComCat, dispatcherSpec, clsctx, addnPath)
File "C:\Python31\lib\site-packages\win32com\server\register.py", line 187, in RegisterServer
_set_string(keyNameRoot, desc)
File "C:\Python31\lib\site-packages\win32com\server\register.py", line 32, in _set_string
value)
pywintypes.error: (5, 'RegSetValue', 'Access is denied.')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Python31\Lib\site-packages\win32comext\axscript\client\pyscript.py", line 372, in <module>
Register()
File "C:\Python31\Lib\site-packages\win32comext\axscript\client\pyscript.py", line 368, in Register
finalize_register=DllRegisterServer)
File "C:\Python31\lib\site-packages\win32com\server\register.py", line 574, in UseCommandLine
ReExecuteElevated(flags)
File "C:\Python31\lib\site-packages\win32com\server\register.py", line 531, in ReExecuteElevated
nShow=win32con.SW_SHOW)
pywintypes.error: (2, 'ShellExecuteEx', 'The system cannot find the file specified.')

Are there any simple temporary fixes for this? I'd love to get this up and running. :)

Discussion

  • Mark Hammond
    Mark Hammond
    2009-12-24

    A work around may be to use an elevated command prompt (ie, started with "Run as Administrator") and executing pyscript.py there. If that fails too, I suspect it will be a general problem with Python 3.x - trying Python 2.6 should also work.

     
  • Comment has been marked as spam. 
    Undo

    You can see all pending comments posted by this user  here


    Anonymous
    2009-12-24

    Yeah I found that out myself after like one hour of code-sifting. Thanks :)

     
    Last edit: Anonymous 2015-11-28
  • Mark Hammond
    Mark Hammond
    2012-01-28

    • status: open --> closed-works-for-me
     
  • Mark Hammond
    Mark Hammond
    2012-01-28

    I can't reproduce this with the current source tree - please re-open if it still happens once build 217 comes out (which should be soon!)