Win98 threads

Peter Hansen peter at engcorp.com
Tue Dec 17 08:45:12 EST 2002


Anand B Pillai wrote:
> 
> But my question is still valid, in another sense. The concerned
> thread was calling a function for walking a directory and doing some
> operation on the files. I found that the following line was causing
> problems for the thread.
> 
> def ThreadFunc(self, event):
>     #...
> 
>     currfile = os.path.abspath(self._fileName)
>     #operations on currfile...
> 
> Once I removed the call to os.path.abspath() the code runs fine in
> the thread. The variable self._fileName in itself contains the file fullpath
> . I had added the call to os.path.abspath to just make sure of it. I also
> find that the code using this call works fine in the main thread.
> 
> Here is the whole code for your perusal;

If that was the *whole* code, your problem might be that you
forgot to "import os" at the top, so the line in question actually
raises an exception and the thread terminates.  Is there no traceback
displayed?  Are you running this from a console, or some other way?

-Peter



More information about the Python-list mailing list