Turning off warnings

P

Paulo Pinto

Hi,

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?

Thanks,
Paulo
 
G

Gerrit Holl

Paulo said:
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
 
?

=?ISO-8859-1?Q?Gerhard_H=E4ring?=

Paulo said:
[...] Now when I use os.tempnam() or os.tmpnam()
I get a runtime warning about security issues. [...]

Is there any way to turn the message off?
'C:\\DOCUME~1\\GERHAR~1.HAE\\LOCALS~1\\Temp\\2'

-- Gerhard
 
M

Martin Franklin

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top