Skip to content

Commit

Permalink
pythongh-95376: Add test for names containing null (#pythonGH-5394)
Browse files Browse the repository at this point in the history
Co-authored-by: Erlend Egeberg Aasland <[email protected]>
  • Loading branch information
Yaminyam and erlend-aasland authored Aug 6, 2022
1 parent 4703c15 commit a17cd47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Lib/test/test_pwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ def test_errors(self):
self.assertRaises(TypeError, pwd.getpwnam)
self.assertRaises(TypeError, pwd.getpwnam, 42)
self.assertRaises(TypeError, pwd.getpwall, 42)
# embedded null character
self.assertRaisesRegex(ValueError, 'null', pwd.getpwnam, 'a\x00b')

# try to get some errors
bynames = {}
Expand Down

0 comments on commit a17cd47

Please sign in to comment.