diff options
author | Sion Kang <31057849+Yaminyam@users.noreply.github.com> | 2022-08-06 16:53:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-06 16:53:19 (GMT) |
commit | a17cd47b614f8bc660788647a009a25e121221d7 (patch) | |
tree | 4c1295f071bdace647d941b071bff9582c83e912 | |
parent | 4703c158116bd157e20938bbf5356b79422470bb (diff) | |
download | cpython-a17cd47b614f8bc660788647a009a25e121221d7.zip cpython-a17cd47b614f8bc660788647a009a25e121221d7.tar.gz cpython-a17cd47b614f8bc660788647a009a25e121221d7.tar.bz2 |
gh-95376: Add test for names containing null (#GH-5394)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
-rw-r--r-- | Lib/test/test_pwd.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_pwd.py b/Lib/test/test_pwd.py index c789326..aa090b4 100644 --- a/Lib/test/test_pwd.py +++ b/Lib/test/test_pwd.py @@ -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 = {} |