[python-win32] winshell error

Mike Driscoll mdriscoll at co.marshall.ia.us
Thu Jan 24 21:14:40 CET 2008


Hi Tim,

> Message: 6
> Date: Thu, 24 Jan 2008 16:23:47 +0000
> From: Tim Golden <mail at timgolden.me.uk>
> Subject: Re: [python-win32] winshell error
> Cc: python-win32 at python.org
> Message-ID: <4798BB93.9030302 at timgolden.me.uk>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Mike Driscoll wrote:
> > I have a Python login script that runs various things on 
> login for the
> > users in our Windows domain. Every once in a while, I'll 
> get a traceback
> > when I use winshell to try to find the user's desktop. The 
> offending code
> > is:
> > 
> > userDesktop = winshell.desktop()
> > 
> > And the traceback:
> > 
> > File "\\servername\logon\MCISpy.py", line 256, in ?
> >     import SoScripts
> >   File 
> "\\servername\logon\PythonPackages\Utilities\SoScripts.py", line
> > 42, in ?
> >     userDesktop = winshell.desktop()
> >   File 
> "\\servername\logon\Python24\lib\site-packages\winshell.py", line
> > 48, in desktop
> >     return get_path ((shellcon.CSIDL_DESKTOP,
> > shellcon.CSIDL_COMMON_DESKTOPDIRECTORY)[common])
> >   File 
> "\\servername\logon\Python24\lib\site-packages\winshell.py", line
> > 44, in get_path
> >     return shell.SHGetPathFromIDList 
> (shell.SHGetSpecialFolderLocation (0,
> > folder_id))
> > com_error: (-2147467259, 'Unspecified error', None, None)
> > 
> > 
> > Our login scripts have an error reporting module that emails the
> > tracebacks to us when they occur. Since this doesn't happen 
> every time the
> > user logs in, it is difficult to track down. Does anyone 
> know what this is
> > and how to fix it?
> 
> Doing things in login scripts is, unfortunately, a recipe for
> sporadic issues of this sort. I don't know if it's documented
> (and I haven't actually looked too hard) but the interaction
> between the Windows Shell's own startup activities and a
> domain-level logon script seems to be ill-defined.
> 
> I hope that someone reading this has more recent experience
> (and more knowledge) than I do re login scripts, but when I
> was responsible for a several-thousand-line Kixtart login
> script, we found that we just had to throw in random delays
> -- perhaps, here, catching the exception and trying again after
> delay -- because the login script had somehow got ahead of the
> desktop / profile setup.
> 
> TJG
> 
> 

When I was hired, I had to convert almost all our Kixtart scripts to
Python. The Kixtart programmer we had didn't seem to understand loops or
functions, so the code was a mess and very difficult to follow. Thus, I
don't know if his was any more reliable than the Python login scripts, but
at least we know when the Python ones have a problem.

I don't know if putting in a delay is feasible. We get complaints from
users on our T1 and wireless connections that it's too slow. Maybe I'll
spin some of the stuff into their own threads that can repeat themselves
in some kind of try/exception loop for x iterations...

Mike



More information about the python-win32 mailing list