Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 084cfc7

Browse files
committed
Fix for an Issue #415
1 parent e7c66a2 commit 084cfc7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/core/dump.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)