This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Ilya.Kulakov
Recipients Ilya.Kulakov, ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2016-06-20.02:32:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1466389929.18.0.227515818606.issue27354@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2016-06-20 02:32:09Ilya.Kulakovsetrecipients: + Ilya.Kulakov, paul.moore, vstinner, tim.golden, ezio.melotti, zach.ware, steve.dower
2016-06-20 02:32:09Ilya.Kulakovsetmessageid: <1466389929.18.0.227515818606.issue27354@psf.upfronthosting.co.za>
2016-06-20 02:32:08Ilya.Kulakovlinkissue27354 messages
2016-06-20 02:32:07Ilya.Kulakovcreate