diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-08-28 13:33:21 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-08-28 13:33:21 (GMT) |
commit | 876473eba3e7fab7d91446b66bd58c43d8c96647 (patch) | |
tree | d2a8eb174e83d23d141369bcd46a07cc2f27786c /Lib/test/test_ssl.py | |
parent | 13056bff6688211c0646d22c4796c75dd84d5a9a (diff) | |
download | cpython-876473eba3e7fab7d91446b66bd58c43d8c96647.zip cpython-876473eba3e7fab7d91446b66bd58c43d8c96647.tar.gz cpython-876473eba3e7fab7d91446b66bd58c43d8c96647.tar.bz2 |
fix load_verify_locations on unicode paths (closes #22244)
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index a5785d0..72a65b7 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -850,11 +850,14 @@ class ContextTests(unittest.TestCase): ctx.load_verify_locations(cafile=CERTFILE, capath=None) ctx.load_verify_locations(BYTES_CERTFILE) ctx.load_verify_locations(cafile=BYTES_CERTFILE, capath=None) + ctx.load_verify_locations(cafile=BYTES_CERTFILE.decode('utf-8')) self.assertRaises(TypeError, ctx.load_verify_locations) self.assertRaises(TypeError, ctx.load_verify_locations, None, None, None) with self.assertRaises(IOError) as cm: ctx.load_verify_locations(WRONGCERT) self.assertEqual(cm.exception.errno, errno.ENOENT) + with self.assertRaises(IOError): + ctx.load_verify_locations(u'') with self.assertRaisesRegexp(ssl.SSLError, "PEM lib"): ctx.load_verify_locations(BADCERT) ctx.load_verify_locations(CERTFILE, CAPATH) |