From: Jean-Michel Nirgal Vourgère Date: Tue, 12 Apr 2011 08:13:40 +0000 (+0000) Subject: Be more verbose on file creation error X-Git-Url: https://git.nirgal.com/?p=ais.git;a=commitdiff_plain;h=7075af7290abd4f59aa91c64ab0a9f17e61d147f;hp=9bbfbc00795fb658f1d9bf3a0324153bcfa6aa2d Be more verbose on file creation error --- diff --git a/bin/ntools.py b/bin/ntools.py index c60fc8d..e5a3073 100644 --- a/bin/ntools.py +++ b/bin/ntools.py @@ -3,6 +3,7 @@ from __future__ import division import os import calendar +import logging __all__ = [ 'IPV4_IN_IPV6_PREFIX', @@ -76,6 +77,7 @@ def open_with_mkdirs(filename, mode): try: return file(filename, mode) except IOError, ioerr: + logging.warning("file(%s,%s): errno %s %s", filename, mode, ioerr.errno, ioerr.strerror) # FIXME only if doesn't exists ... #print 'Creating directory', os.path.dirname(filename) os.makedirs(os.path.dirname(filename))