https://github.com/python/cpython/commit/63a949487840f9b4b1d81df3aba06230ca8e5c28
commit: 63a949487840f9b4b1d81df3aba06230ca8e5c28
branch: 3.13
author: Miss Islington (bot) <31488909+miss-isling...@users.noreply.github.com>
committer: serhiy-storchaka <storch...@gmail.com>
date: 2025-08-11T16:04:54+03:00
summary:

[3.13] Add test for opening an SQLite with bytes path (GH-136331) (GH-137633)

Add test for opening an SQLite with bytes path (GH-136331)
(cherry picked from commit 1bde13b0e99592fbfce3538b27ada29ea09840a6)

Co-authored-by: Serhiy Storchaka <storch...@gmail.com>

files:
M Lib/test/test_sqlite3/test_dbapi.py

diff --git a/Lib/test/test_sqlite3/test_dbapi.py 
b/Lib/test/test_sqlite3/test_dbapi.py
index 290317c6977e53..f67dab80400ce3 100644
--- a/Lib/test/test_sqlite3/test_dbapi.py
+++ b/Lib/test/test_sqlite3/test_dbapi.py
@@ -660,6 +660,14 @@ def test_deserialize_corrupt_database(self):
 class OpenTests(unittest.TestCase):
     _sql = "create table test(id integer)"
 
+    def test_open_with_bytes_path(self):
+        path = os.fsencode(TESTFN)
+        self.addCleanup(unlink, path)
+        self.assertFalse(os.path.exists(path))
+        with contextlib.closing(sqlite.connect(path)) as cx:
+            self.assertTrue(os.path.exists(path))
+            cx.execute(self._sql)
+
     def test_open_with_path_like_object(self):
         """ Checks that we can successfully connect to a database using an 
object that
             is PathLike, i.e. has __fspath__(). """

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to