gh-95376: Add test for names containing null (GH-GH-5394) (GH-95747)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
(cherry picked from commit a17cd47b61)

Co-authored-by: Sion Kang <31057849+Yaminyam@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2022-08-06 10:32:27 -07:00 committed by GitHub
parent 9278fc4e27
commit f05a0f48e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,6 +59,8 @@ class PwdTest(unittest.TestCase):
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 = {}