Turning off warnings

Martin Franklin mfranklin1 at gatwick.westerngeco.slb.com
Mon Dec 1 10:36:57 EST 2003


On Mon, 2003-12-01 at 15:26, Gerrit Holl wrote:
> 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!
> 

Or use the *updated for security in 2.3* tempfile module

pydoc tempfile

or 

http://www.python.org/doc/current/lib/module-tempfile.html


Regards
Martin

-- 
Martin Franklin <mfranklin1 at gatwick.westerngeco.slb.com>






More information about the Python-list mailing list