From f273b4953497b15e5ef0a75af3c803c7f1edac94 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 7 Jul 2025 15:14:17 +0300 Subject: [PATCH] gh-124486: Fix test_whichdb_ndbm in test_dbm on NetBSD (GH-136335) On NetBSD, ndbm.open() does not fail for empty file. (cherry picked from commit b7aa2a4b4df697db6ea45a555eeb3fefa5ca5bd4) Co-authored-by: Serhiy Storchaka --- Lib/test/test_dbm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_dbm.py b/Lib/test/test_dbm.py index 4be7c5649da68a..6785aa273ac7db 100644 --- a/Lib/test/test_dbm.py +++ b/Lib/test/test_dbm.py @@ -213,7 +213,8 @@ def test_whichdb(self): @unittest.skipUnless(ndbm, reason='Test requires ndbm') def test_whichdb_ndbm(self): # Issue 17198: check that ndbm which is referenced in whichdb is defined - with open(_fname + '.db', 'wb'): pass + with open(_fname + '.db', 'wb') as f: + f.write(b'spam') _bytes_fname = os.fsencode(_fname) fnames = [_fname, os_helper.FakePath(_fname), _bytes_fname, os_helper.FakePath(_bytes_fname)] pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy