Skip to content

Commit f273b49

Browse files
serhiy-storchakamiss-islington
authored andcommitted
pythongh-124486: Fix test_whichdb_ndbm in test_dbm on NetBSD (pythonGH-136335)
On NetBSD, ndbm.open() does not fail for empty file. (cherry picked from commit b7aa2a4) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
1 parent 843e805 commit f273b49

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Lib/test/test_dbm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ def test_whichdb(self):
213213
@unittest.skipUnless(ndbm, reason='Test requires ndbm')
214214
def test_whichdb_ndbm(self):
215215
# Issue 17198: check that ndbm which is referenced in whichdb is defined
216-
with open(_fname + '.db', 'wb'): pass
216+
with open(_fname + '.db', 'wb') as f:
217+
f.write(b'spam')
217218
_bytes_fname = os.fsencode(_fname)
218219
fnames = [_fname, os_helper.FakePath(_fname),
219220
_bytes_fname, os_helper.FakePath(_bytes_fname)]

0 commit comments

Comments
 (0)
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