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 yan12125
Recipients martin.panter, serhiy.storchaka, yan12125
Date 2016-12-27.10:09:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1482833341.48.0.70408057792.issue29082@psf.upfronthosting.co.za>
In-reply-to
Content
In issue27330, 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 issue27330.

[1] e04c054beb53
History
Date User Action Args
2016-12-27 10:09:01yan12125setrecipients: + yan12125, martin.panter, serhiy.storchaka
2016-12-27 10:09:01yan12125setmessageid: <1482833341.48.0.70408057792.issue29082@psf.upfronthosting.co.za>
2016-12-27 10:09:01yan12125linkissue29082 messages
2016-12-27 10:09:00yan12125create