diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-08-06 17:32:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-06 17:32:27 (GMT) |
commit | f05a0f48e82ba5759f2e405de58ce0d0028b0af6 (patch) | |
tree | da8cff8f2b984452362d28278c1a6c9b0d3441b7 /Lib/test/test_pwd.py | |
parent | 9278fc4e27d7b4bad03cb0976fff80828b149ed2 (diff) | |
download | cpython-f05a0f48e82ba5759f2e405de58ce0d0028b0af6.zip cpython-f05a0f48e82ba5759f2e405de58ce0d0028b0af6.tar.gz cpython-f05a0f48e82ba5759f2e405de58ce0d0028b0af6.tar.bz2 |
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 a17cd47b614f8bc660788647a009a25e121221d7)
Co-authored-by: Sion Kang <31057849+Yaminyam@users.noreply.github.com>
Diffstat (limited to 'Lib/test/test_pwd.py')
-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 f8f1257..d217e05 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 = {} |