New submission from Ilya Kulakov: On Windows 8.1 x64 with Python 3.5.1 I was able to reproduce the issue by attempting to load a file at "C:\Users\غازي\AppData\Local\Temp\_غازي_70e5wbxo\cacert.pem".
locale.getdefaultlocale() > ('en_US', 'cp1252') locale.getpreferredencoding() > 'cp1252' sys.getfilesystemencoding() > 'mbcs' sys.getdefaultencoding() > 'utf-8' c = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) c.load_verify_locations(cafile=r"C:\Users\غازي\AppData\Local\Temp\_غازي_70e5wbxo\cacert.pem") > TypeError: cafile should be a valid filesystem path c.load_verify_locations(cafile=r"C:\Users\غازي\AppData\Local\Temp\_غازي_70e5wbxo\cacert.pem".encode(sys.getfilesystemencoding())) > UnicodeEncodeError: 'mbcs' codec can't encode characters in positions 0--1: invalid character c.load_verify_locations(cafile=r"C:\Users\غازي\AppData\Local\Temp\_غازي_70e5wbxo\cacert.pem".encode('utf-8')) > ok ---------- components: Extension Modules, Unicode, Windows messages: 268880 nosy: Ilya.Kulakov, ezio.melotti, haypo, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: SSLContext.load_verify_locations cannot handle paths on Windows which cannot be encoded using mbcs versions: Python 3.5 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27354> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com