Turning off warnings

Gerhard Häring gh at ghaering.de
Mon Dec 1 10:31:06 EST 2003


Paulo Pinto wrote:
> [...] 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?

 >>> import os, warnings
 >>> warnings.filterwarnings("ignore", "tempnam")
 >>> os.tempnam()
'C:\\DOCUME~1\\GERHAR~1.HAE\\LOCALS~1\\Temp\\2'

-- Gerhard






More information about the Python-list mailing list