Minor fix for dumping non-alphanumeric database names

This commit is contained in:
Miroslav Stampar 2013-11-12 13:13:47 +01:00
parent abd76081e1
commit 2f1607b4d5

View File

@ -8,6 +8,7 @@ See the file 'doc/COPYING' for copying permission
import cgi import cgi
import codecs import codecs
import os import os
import re
import threading import threading
from lib.core.common import Backend from lib.core.common import Backend
@ -379,7 +380,7 @@ class Dump(object):
self._write(tableValues, content_type=CONTENT_TYPE.DUMP_TABLE) self._write(tableValues, content_type=CONTENT_TYPE.DUMP_TABLE)
return return
dumpDbPath = "%s%s%s" % (conf.dumpPath, os.sep, unsafeSQLIdentificatorNaming(db)) dumpDbPath = "%s%s%s" % (conf.dumpPath, os.sep, re.sub(r"[^\w]", "_", unsafeSQLIdentificatorNaming(db)))
if conf.dumpFormat == DUMP_FORMAT.SQLITE: if conf.dumpFormat == DUMP_FORMAT.SQLITE:
replication = Replication("%s%s%s.sqlite3" % (conf.dumpPath, os.sep, unsafeSQLIdentificatorNaming(db))) replication = Replication("%s%s%s.sqlite3" % (conf.dumpPath, os.sep, unsafeSQLIdentificatorNaming(db)))