diff --git a/lib/newfol/filemanip.py b/lib/newfol/filemanip.py index 05746ed..1fd7da8 100644 --- a/lib/newfol/filemanip.py +++ b/lib/newfol/filemanip.py @@ -210,12 +210,12 @@ class FileFormat: self._txnstore = txn self._options = options or {} def _open(self, mode): - self._txnstore.prepare_open(self._filename, "w") + self._txnstore.prepare_open(self._filename, mode) if self._isfp: fp = self._file else: fp = open(self._filename, mode) - self._txnstore.commit_open(self._filename, "w") + self._txnstore.commit_open(self._filename, mode) return fp def _close(self, fp): self._txnstore.prepare_close() diff --git a/test/testfilemanip.py b/test/testfilemanip.py index 7161ab6..cbe0529 100755 --- a/test/testfilemanip.py +++ b/test/testfilemanip.py @@ -85,7 +85,6 @@ class SHA256TransactionTest(unittest.TestCase): x.tempfile = self.create_small_database(x.tempdir) x.fs = FileStorage("csv", x.tempfile, "sha256", *args) return x - @unittest.expectedFailure def test_missing_not_forgiving(self): x = self.create_filestorage({"forgiving": False}) with self.assertRaisesRegex(newfol.exception.UpgradeNeededError,