File Creation Not Working In A Thread Class?

Arnaud Delobelle arnodel at googlemail.com
Sun May 11 13:36:25 EDT 2008


bc90021 <python at bc90021.net> writes:

> Hi All,
>
> Thanks in advance for any and all help!
>
> I have this code:
>
> g = open(fileName, 'a')
>
> where fileName is defined before the line it's used in.  It works fine 
> when I use it outside a thread class.
>
> When I put the same line in a thread class, it no longer works, and I get 
> an error:
>
> IOError: [Errno 2] no such file u'fileName'
>

It's telling you that you haven't got a file called 'fileName'.
Posting the code that triggers this error would allow people to
diagnose the error accurately rather than guessing.

-- 
Arnaud



More information about the Python-list mailing list