473,698 Members | 2,972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1436
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******* *************@p owergate.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
1965
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
1747
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 py-pychecker-run command, but it fails with the "Symbol's function definition is void: read-shell-command" error. I don't know elisp, but seems this is the point where the error occurs: ;; Pychecker (defun py-pychecker-run (command) "*Run pychecker...
1
1477
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 fixes and some new warnings were added. I hope to get future releases out faster. I have several patches queued up and ideas for more warnings. As always, I'd like to hear your suggestions for common mistakes and bugs than can/should be...
10
3818
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 ignored.) Running it from the Python interpreter in DOS means everything scrolls off the screen. Ideally I'd like to redirect it to a file, or be able to use it in IDLE. -- Ben Sizer
4
2257
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
2082
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) What does this mean? Cannot functions be large? Or is it simply an advice that functions should be small and simple?
21
1942
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 of all types of the program, without any kind of variable declaration. This would definitely brings a lot of power to python. The idea is to analyse the whole program, identify constraints on function arguments and check that these constraints...
1
1403
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. Wow, time really does fly. Since it's been so long I'm sure I screwed something up, treat it delicately. It may have bugs and erase your hard drive. If that happens, look on the bright side, you won't have any more bugs. :-) PyChecker is a...
4
1940
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
0
9170
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9031
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8904
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6531
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4624
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.