Skip to content

Commit a17cd47

Browse files
pythongh-95376: Add test for names containing null (#pythonGH-5394)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
1 parent 4703c15 commit a17cd47

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/test/test_pwd.py

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def test_errors(self):
5959
self.assertRaises(TypeError, pwd.getpwnam)
6060
self.assertRaises(TypeError, pwd.getpwnam, 42)
6161
self.assertRaises(TypeError, pwd.getpwall, 42)
62+
# embedded null character
63+
self.assertRaisesRegex(ValueError, 'null', pwd.getpwnam, 'a\x00b')
6264

6365
# try to get some errors
6466
bynames = {}

0 commit comments

Comments
 (0)