Turning off warnings

Gerrit Holl gerrit at nl.linux.org
Mon Dec 1 10:26:38 EST 2003


Paulo Pinto wrote:
> I need to generate a temporary name for a
> file and pass it as argument to a shell
> script.
> 
> Now when I use os.tempnam() or os.tmpnam()
> I get a runtime warning about security issues.
> 
> I am well aware of them, but in the context of
> this application I really don't need to care
> about it.
> 
> Is there any way to turn the message off?

You can either do so from the commandline, or use the warning module.
You probably want to use the latter.
The documentation for the warnings module can be found at:

http://www.python.org/dev/doc/devel/lib/module-warnings.html

You probably want to do:

warnings.filterwarnings("ignore")

Hope this helps!

Gerrit.

-- 
12. If the witnesses be not at hand, then shall the judge set a limit,
at the expiration of six months. If his witnesses have not appeared within
the six months, he is an evil-doer, and shall bear the fine of the pending
case.
          -- 1780 BC, Hammurabi, Code of Law
-- 
Asperger's Syndrome - a personal approach:
	http://people.nl.linux.org/~gerrit/english/





More information about the Python-list mailing list