[python-win32] Winshell issues

Michael M Mason michael at shamirlens.co.uk
Tue Aug 11 19:41:07 CEST 2009


> Hi,
> 
> I've been using Tim Golden's winshell module for a couple of years and

> just in the last week or so, I've been receiving the following error 
> from multiple users:
> 
> Traceback (most recent call last):
>   File "\\debianso\loginscript$\MCISpy.py", line 267, in ?
>     import SoScripts
>   File
"\\debianso\loginscript$\PythonPackages\Utilities\SoScripts.py", line
49, in ?
>     program_files = winshell.programs()     
>   File
"\\Debianis\loginscript$\Python24\lib\site-packages\winshell.py", line
71, in programs
>     return get_path ((shellcon.CSIDL_PROGRAMS,
shellcon.CSIDL_COMMON_PROGRAMS)[common])
>   File
"\\Debianis\loginscript$\Python24\lib\site-packages\winshell.py", line
44, in get_path
>     return shell.SHGetPathFromIDList (shell.SHGetSpecialFolderLocation
(0, folder_id))
>     com_error: (-2147024893, 'The system cannot find the path
specified.', None, None)

Does it work any better if you try this (in the Python Shell):-

>>> from win32com.shell import shell, shellcon
>>> shell.SHGetFolderPath (0, shellcon.CSIDL_COMMON_PROGRAMS, None, 0)

I'm using Python 3 so I had to mess about to get winshell.py to work.
I've also found that the results returned from winshell are byte arrays
whereas the results returned from the example above are strings.  I
don't know whether that matters in Python 2.4, but it matters in Python
3.

I have no idea at all why you should suddenly have a problem if it was
working before.

-- 
Michael



More information about the python-win32 mailing list