@@ -379,11 +379,11 @@ def dbTableValues(self, tableValues):
379379 self ._write (tableValues , content_type = CONTENT_TYPE .DUMP_TABLE )
380380 return
381381
382+ dumpDbPath = "%s%s%s" % (conf .dumpPath , os .sep , unsafeSQLIdentificatorNaming (db ))
383+
382384 if conf .dumpFormat == DUMP_FORMAT .SQLITE :
383385 replication = Replication ("%s%s%s.sqlite3" % (conf .dumpPath , os .sep , unsafeSQLIdentificatorNaming (db )))
384386 elif conf .dumpFormat in (DUMP_FORMAT .CSV , DUMP_FORMAT .HTML ):
385- dumpDbPath = "%s%s%s" % (conf .dumpPath , os .sep , unsafeSQLIdentificatorNaming (db ))
386-
387387 if not os .path .isdir (dumpDbPath ):
388388 os .makedirs (dumpDbPath , 0755 )
389389
@@ -522,6 +522,9 @@ def dbTableValues(self, tableValues):
522522 if len (value ) > MIN_BINARY_DISK_DUMP_SIZE and r'\x' in value :
523523 mimetype = magic .from_buffer (value , mime = True )
524524 if any (mimetype .startswith (_ ) for _ in ("application" , "image" )):
525+ if not os .path .isdir (dumpDbPath ):
526+ os .makedirs (dumpDbPath , 0755 )
527+
525528 filepath = os .path .join (dumpDbPath , "%s-%d.bin" % (column , randomInt (8 )))
526529 warnMsg = "writing binary ('%s') content to file '%s' " % (mimetype , filepath )
527530 logger .warn (warnMsg )
0 commit comments