By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,767 Members | 1,375 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,767 IT Pros & Developers. It's quick & easy.

PyChecker and stdin

P: n/a
Is there a way to tell PyChecker to "skip" a line of source code? Or
any other workarounds would also greatly appreciated.

This line:
s = sys.stdin.read(4)
Causes this PyChecker error:
IOError: [Errno 9] Bad file descriptor
Thanks much for your help.

Olaf
Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Olaf Meding wrote:
Is there a way to tell PyChecker to "skip" a line of source code? Or
any other workarounds would also greatly appreciated.


(I don't know how to skip a line, but) PyChecker has to be able to
import the code. If you put the failing code in a function that
is called from a '__main__' section, rather than having all code
execute on import, it should solve your problem.

-Peter
Jul 18 '05 #2

P: n/a
Peter
... 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.

Olaf

Jul 18 '05 #3

P: n/a
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
Jul 18 '05 #4

P: n/a
> Is there a way to tell PyChecker to "skip" a line of source code?
Any other ideas are greatly appreciated. Thanks.


Comment the line just before a PyChecker run. That's how I get
PyChecker to skip a line.

- Josiah
Jul 18 '05 #5

P: n/a
Turns out the that the function with the line of code PyChecker
complained about was called during import. Thanks much for your help.

Olaf
Peter Hansen <pe***@engcorp.com> wrote in message news:<ee********************@powergate.ca>...
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

Jul 18 '05 #6

P: n/a
Olaf Meding wrote:
Turns out the that the function with the line of code PyChecker
complained about was called during import. Thanks much for your help.


No problem. And thanks for the closure! Too often we never hear
back from someone, whether positively or negatively. :-)

-Peter
Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.