PyChecker and stdin

Peter Hansen peter at engcorp.com
Tue Mar 30 23:35:29 EST 2004


Olaf Meding wrote:

>>... put the failing code in a function ...
> 
> This line of code is already inside some function!
>   s = sys.stdin.read(4)
> Causes this PyChecker error:
>   IOError: [Errno 9] Bad file descriptor
> 
> Any other ideas are greatly appreciated.  Thanks.

Are you _certain_ that this function is not being executed
during import?  I'd be surprised if the form of the error
messages (warnings?) which PyChecker outputs exactly matches
what you show above, which strongly appears to be a standard
Python exception (and which would therefore be generated _only_
when the code is being executed).

Can you strip out all the non-relevant code in that module
in such a way that it still produces the error, and post
the failing code (assuming it's only a half dozen lines or
so)?  Then at least someone else can try running it and
see what's going on, or we can point out the error of your
ways if that's the situation...

-Peter



More information about the Python-list mailing list