Skip to content

Commit 63a9494

Browse files
[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 1bde13b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 0c8c7fb commit 63a9494

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Lib/test/test_sqlite3/test_dbapi.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,14 @@ def test_deserialize_corrupt_database(self):
660660
class OpenTests(unittest.TestCase):
661661
_sql = "create table test(id integer)"
662662

663+
def test_open_with_bytes_path(self):
664+
path = os.fsencode(TESTFN)
665+
self.addCleanup(unlink, path)
666+
self.assertFalse(os.path.exists(path))
667+
with contextlib.closing(sqlite.connect(path)) as cx:
668+
self.assertTrue(os.path.exists(path))
669+
cx.execute(self._sql)
670+
663671
def test_open_with_path_like_object(self):
664672
""" Checks that we can successfully connect to a database using an object that
665673
is PathLike, i.e. has __fspath__(). """

0 commit comments

Comments
 (0)