self.location = os.path.join(self.location,
self.label.lstrip(os.path.sep).rstrip(os.path.sep))
- if not os.path.exists(self.location):
+ if not self.readonly and not os.path.exists(self.location):
self._ensure_dirs()
config.setdefault("autocommit", self.autocommits)
connection_kwargs = {}
connection_kwargs["timeout"] = config["timeout"]
try:
- self._ensure_dirs()
+ if not self.readonly:
+ self._ensure_dirs()
self._db_connection = self._db_module.connect(
database=_unicode_decode(self._dbpath), **connection_kwargs)
self._db_cursor = self._db_connection.cursor()