473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

PyChecker and stdin

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
6 1429
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
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
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
> 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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: achrist | last post by:
The pychecker site says that pychecker works with versions 1.5 through 2.2. Any reason to expect that 2.3 breaks it? Anyone tried it to see? TIA Al
0
by: Pedro Werneck | last post by:
Hi, I don't know if I should ask this here or on an emacs group/list. If I choose wrong, please forgive me. I am trying to run pychecker on the current buffer on python-mode using the...
1
by: Neal Norwitz | last post by:
A new version of PyChecker is (finally) available for your hacking pleasure. It's been quite a while since the last release--11 months. I wish there was more progress, but such is life. Many bug...
10
by: Kylotan | last post by:
Is there a practical way to use Pychecker in Windows? It doesn't work under IDLE. (In fact, it seems to end up breaking everything, and every subsequent statement and expression I execute gets...
4
by: beliavsky | last post by:
If I run PyChecker on the following program, stored in xtry.py, m = 10000000 k = 0 for i in xrange(m): k = k + i print k x = range(3) print x
8
by: Frans Englich | last post by:
Hello, I take PyChecker partly as an recommender of good coding practice, but I cannot make sense of some of the messages. For example: runner.py:878: Function (main) has too many lines (201)...
21
by: Philippe Fremy | last post by:
Hi, I would like to develop a tool that goes one step further than pychecker to ensure python program validity. The idea would be to get close to what people get on ocaml: a static verification...
1
by: Neal Norwitz | last post by:
Special thanks to Ken Pronovici. He did a lot of work for this release and helped ensure it occurred. Version 0.8.15 of PyChecker is available. It's been over a year since the last release. ...
4
by: Anthony Greene | last post by:
Howdy, I had the impression that pychecker caught and reported such dynamic syntactical errors. #!/usr/bin/env python def add(i): i += 10 status = 3
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.