Large number of failed open()'s importing optparse
"David e Freitas" <[email protected]> Sat, 3 Mar 2007 23:23:31 +0200
| Newsgroups | gmane.comp.python.optik.user |
|---|---|
| Message-ID | <[email protected]> |
Greetings!
I have realized that using "from optparse import OptionParser" causes
a lot of unncessary failed open() calls when running a python script.
Do the following:
$ strace -c python
>>> from optparse import OptionParser
Ctrl-d (Quit)
You will notice
"Calls: 502 Errors:409 Function:open"
There are a lot of failed open()'s.
OK, but the problem is when this is imported in a real py program file.
What happens is that the current directory seems to be added to
python's search path or something similar. So you get a bunch of
failed open's on the current directory, which wouldn't happen if
"optparse" wasn't imported.
Here are the example calls:
###
open("/home/def/Documents/hons/autoappl/hw3/prerelease/dis.so",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/def/Documents/hons/autoappl/hw3/prerelease/dismodule.so",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/def/Documents/hons/autoappl/hw3/prerelease/dis.py",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/home/def/Documents/hons/autoappl/hw3/prerelease/dis.pyc",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
###
Neither of the filenames exist or should exist in the directory or the project.
Hope this can be tracked down to some module that doesn't cleanup
after playing with the PATH or something.
Sincerely,
David
---------------------
http://www.defza.com
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV