@@ -647,25 +647,25 @@ def _createTargetDirs():
647647
648648 conf .outputPath = os .path .join (getUnicode (paths .SQLMAP_OUTPUT_PATH ), normalizeUnicode (getUnicode (conf .hostname )))
649649
650- if not os . path . isdir ( conf . outputPath ) :
651- try :
650+ try :
651+ if not os . path . isdir ( conf . outputPath ) :
652652 os .makedirs (conf .outputPath , 0755 )
653- except (OSError , IOError ), ex :
654- try :
655- tempDir = tempfile .mkdtemp (prefix = "sqlmapoutput" )
656- except Exception , _ :
657- errMsg = "unable to write to the temporary directory ('%s'). " % _
658- errMsg += "Please make sure that your disk is not full and "
659- errMsg += "that you have sufficient write permissions to "
660- errMsg += "create temporary files and/or directories"
661- raise SqlmapSystemException (errMsg )
653+ except (OSError , IOError , TypeError ), ex :
654+ try :
655+ tempDir = tempfile .mkdtemp (prefix = "sqlmapoutput" )
656+ except Exception , _ :
657+ errMsg = "unable to write to the temporary directory ('%s'). " % _
658+ errMsg += "Please make sure that your disk is not full and "
659+ errMsg += "that you have sufficient write permissions to "
660+ errMsg += "create temporary files and/or directories"
661+ raise SqlmapSystemException (errMsg )
662662
663- warnMsg = "unable to create output directory "
664- warnMsg += "'%s' (%s). " % (conf .outputPath , getUnicode (ex ))
665- warnMsg += "Using temporary directory '%s' instead" % getUnicode (tempDir )
666- logger .warn (warnMsg )
663+ warnMsg = "unable to create output directory "
664+ warnMsg += "'%s' (%s). " % (conf .outputPath , getUnicode (ex ))
665+ warnMsg += "Using temporary directory '%s' instead" % getUnicode (tempDir )
666+ logger .warn (warnMsg )
667667
668- conf .outputPath = tempDir
668+ conf .outputPath = tempDir
669669
670670 try :
671671 with codecs .open (os .path .join (conf .outputPath , "target.txt" ), "w+" , UNICODE_ENCODING ) as f :
0 commit comments