msg284081 - (view) |
Author: (yan12125) * |
Date: 2016-12-27 10:09 |
In , there's one more change besides fixing possible memory leaks. In LoadLibrary function of _ctypes: [1] - if (!PyArg_ParseTuple(args, "O|O:LoadLibrary", &nameobj, &ignored)) + if (!PyArg_ParseTuple(args, "S |
O:LoadLibrary", &nameobj, &ignored)) Before this change, both bytes and unicode objects are accepted in _ctypes.LoadLibrary() (Unicode objects are implicitly converted to bytes), and after this change only bytes objects are valid. There are two options: * Revert the relevant PyArg_ParseTuple. It's better to have fewer surprises on 2.7 branch :) * Document the change. I prefer the first option as in our project ```from __future__ import unicode_literals``` is used everywhere, and in Python 3 only Unicode objects are acceptable in _ctypes.LoadLibrary(). Downstream report: https://github.com/rg3/youtube-dl/issues/11540 Added the author and the reviewer in . [1] e04c054beb53 |
|
msg284099 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2016-12-27 14:04 |
Good catch Chi Hsuan Yen! This is my mistake, I though PyString_Size() works only with str (as many similar *_Size() functions). Agreed, this change should be reverted. Do you want provide the patch with tests? |
|
|
msg284111 - (view) |
Author: (yan12125) * |
Date: 2016-12-27 16:37 |
Sorry, but I'm afraid of being unable to test it. I tried to setup a Windows build environment for 2.x but failed. (I've once successfully built 3.x on Windows for , but things seems different now :( |
|
|
msg284398 - (view) |
Author: (yan12125) * |
Date: 2016-12-31 16:31 |
I finally get Windows builds working. Here's the patch. |
|
|
msg284399 - (view) |
Author: (yan12125) * |
Date: 2016-12-31 16:35 |
Oops, Parser/asdl_c.py shouldn't be included. Here's the correct patch |
|
|
msg284948 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2017-01-08 01:40 |
Other tests are skipped if libc_name is None, so your assertion is inconsistent. FTR there are reports open about problems with bootstrap files like asdl_c.py, e.g. Issue 28143 proposing to port that file to Python 3, and Issue 23404 about the future of “make touch”. |
|
|
msg285327 - (view) |
Author: (yan12125) * |
Date: 2017-01-12 13:53 |
Here's a new patch using fake library names. And thanks for those related issues about asdl_c.py! |
|
|
msg285330 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2017-01-12 15:00 |
New changeset 4ce22d69e134 by Serhiy Storchaka in branch '2.7': Issue #29082: Fixed loading libraries in ctypes by unicode names on Windows. https://hg.python.org/cpython/rev/4ce22d69e134 |
|
|
msg285344 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2017-01-12 19:43 |
Committed with changed test. Thank you for your patch Chi Hsuan Yen. |
|
|