classification
Title: load_verify_locations fails to handle unicode paths on Python 2
Type: Stage: resolved
Components: Extension Modules Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: alex, benjamin.peterson, christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou, python-dev
Priority: normal Keywords: needs review, patch

Created on 2014-08-21 20:46 by alex, last changed 2014-08-28 13:33 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
t22244.diff alex, 2014-08-22 19:48
t22244.diff alex, 2014-08-23 04:30
Messages (8)
msg225614 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2014-08-21 20:46
Details of the issue are here: http://bugs.python.org/msg225613

I'm not sure what the correct API to use is there, perhaps the encoding can be folded into the PyArg_ParseTupleAndKeywords() call.
msg225700 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2014-08-22 19:48
Attached patch resolves the issue, includes a test.
msg225727 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2014-08-23 04:17
Can't you just use "et" in PyArg_Parse?
msg225728 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2014-08-23 04:21
Unfortunately no, the API accepts explicit Nones (in addition to simply not passing the argument), and et errors on those.
msg225729 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2014-08-23 04:24
You could do all the argument conversion in the Python SSLContext class and then delegate to the base _SSLContext class...
msg225730 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2014-08-23 04:25
It's not clear to me that that's better, and it makes the diff with the Python3 version larger.
msg225731 - (view) Author: Alex Gaynor (alex) * (Python committer) Date: 2014-08-23 04:30
Attached patch adds an additional test for a more interesting unicode path.
msg226022 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-28 13:33
New changeset 97081a80f487 by Benjamin Peterson in branch '2.7':
fix load_verify_locations on unicode paths (closes #22244)
http://hg.python.org/cpython/rev/97081a80f487
History
Date User Action Args
2014-08-28 13:33:28python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg226022

resolution: fixed
stage: resolved
2014-08-23 04:30:30alexsetfiles: + t22244.diff

messages: + msg225731
2014-08-23 04:25:25alexsetmessages: + msg225730
2014-08-23 04:24:25pitrousetmessages: + msg225729
2014-08-23 04:21:28alexsetmessages: + msg225728
2014-08-23 04:17:53benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg225727
2014-08-22 19:48:15alexsetkeywords: + patch, needs review
files: + t22244.diff
messages: + msg225700
2014-08-21 20:46:55alexcreate