Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyCFunction_New no longer exposed by python DLL breaking bdist_wininst installers #65553

Closed
mhammond opened this issue Apr 26, 2014 · 14 comments
Closed
Assignees
Labels
OS-windows release-blocker type-bug An unexpected behavior, bug, or error

Comments

@mhammond
Copy link
Contributor

BPO 21354
Nosy @mhammond, @birkenfeld, @pitrou, @larryhastings, @tjguk, @asvetlov, @zware, @zooba
Files
  • t.patch: patch to install.c
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/asvetlov'
    closed_at = <Date 2015-04-27.14:50:28.046>
    created_at = <Date 2014-04-26.08:00:55.174>
    labels = ['type-bug', 'OS-windows', 'release-blocker']
    title = 'PyCFunction_New no longer exposed by python DLL breaking bdist_wininst installers'
    updated_at = <Date 2015-04-27.15:26:04.016>
    user = 'https://github.com/mhammond'

    bugs.python.org fields:

    activity = <Date 2015-04-27.15:26:04.016>
    actor = 'berker.peksag'
    assignee = 'asvetlov'
    closed = True
    closed_date = <Date 2015-04-27.14:50:28.046>
    closer = 'asvetlov'
    components = ['Windows']
    creation = <Date 2014-04-26.08:00:55.174>
    creator = 'mhammond'
    dependencies = []
    files = ['35043']
    hgrepos = []
    issue_num = 21354
    keywords = ['patch']
    message_count = 14.0
    messages = ['217185', '217194', '217195', '217384', '227191', '227192', '235535', '235538', '235539', '235540', '240747', '240757', '242116', '242117']
    nosy_count = 9.0
    nosy_names = ['mhammond', 'georg.brandl', 'pitrou', 'larry', 'tim.golden', 'asvetlov', 'python-dev', 'zach.ware', 'steve.dower']
    pr_nums = []
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue21354'
    versions = ['Python 3.4', 'Python 3.5']

    @mhammond
    Copy link
    Contributor Author

    Python 3.3 and earlier have in methodobject.c:

    /* PyCFunction_New() is now just a macro that calls PyCFunction_NewEx(),
    but it's part of the API so we need to keep a function around that
    existing C extensions can call.
    */

    #undef PyCFunction_New
    PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *);

    which means PyCFunction_New is exported from the DLL. Python 3.4 does not have this (which seems a bug in its own right given the comment in 3.3 and earlier) but PC/bdist_wininst/install.c has code that attempts to dynamically load this function from the DLL and fails, causing 3rd party installers to fail.

    Assuming the removal of this API was intentional so the problem is that install.c needs to be updated, the following patch fixes the issue.

    @mhammond mhammond added OS-windows type-bug An unexpected behavior, bug, or error labels Apr 26, 2014
    @pitrou
    Copy link
    Member

    pitrou commented Apr 26, 2014

    This is apparently because mismanagement of issue bpo-15422.

    Andrew, you did the commits, can you restore the PyAPI_FUNC declaration?

    @pitrou
    Copy link
    Member

    pitrou commented Apr 26, 2014

    (while none of PyCFunction_New and PyCFunction_NewEx are documented, they are part of the stable ABI - the python3.def file -, so removing the API is presumably a bug, not a feature)

    @asvetlov
    Copy link
    Contributor

    Ok, I'll take a look. Sorry, probably I've missed python3.def file.

    @larryhastings
    Copy link
    Contributor

    This is still not fixed.

    @birkenfeld
    Copy link
    Member

    Sorry for the "mismanagement", I probably didn't check again after the final resolution.

    @larryhastings
    Copy link
    Contributor

    Still not fixed! This has been marked as "release blocker" for most of a year. Should I just apply the patch?

    @pitrou
    Copy link
    Member

    pitrou commented Feb 8, 2015

    Perhaps Steve can confirm that the patch is right.

    @asvetlov
    Copy link
    Contributor

    asvetlov commented Feb 8, 2015

    I'm sorry.
    The patch is correct from my perspective if we want to make bdist_install just working.
    Or as an option I can restore PyCFunction_New function declaration.

    What do you prefer?

    @zooba
    Copy link
    Member

    zooba commented Feb 8, 2015

    As Andrew says, the patch is fine for the bug, but the PyCFunction_New function is certainly part of the stable ABI and needs to be restored.

    @zware
    Copy link
    Member

    zware commented Apr 13, 2015

    Steve, Andrew, does either of you want to take care of this or shall I give it a shot? I'm figuring on using the patch here and re-adding PyCFunction_New as it had been.

    @asvetlov
    Copy link
    Contributor

    Will do up to weekend.


    Sent from Mailbox

    On Mon, Apr 13, 2015 at 4:58 PM, Zachary Ware <report@bugs.python.org>
    wrote:

    Zachary Ware added the comment:
    Steve, Andrew, does either of you want to take care of this or shall I give it a shot? I'm figuring on using the patch here and re-adding PyCFunction_New as it had been.
    ----------


    Python tracker <report@bugs.python.org>
    <http://bugs.python.org/issue21354\>


    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Apr 27, 2015

    New changeset 69951573cb0e by Andrew Svetlov in branch '3.4':
    Issue bpo-21354: PyCFunction_New function is exposed by python DLL again.
    https://hg.python.org/cpython/rev/69951573cb0e

    @asvetlov
    Copy link
    Contributor

    Fixed. Sorry for long delay.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-windows release-blocker type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    7 participants