Skip to content

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

Closed

Description

@mhammond
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']

    Activity

    1. mhammond commented on Apr 26, 2014

      @mhammond
      ContributorAuthor

      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.

    2. pitrou commented on Apr 26, 2014

      @pitrou
      Member

      This is apparently because mismanagement of issue bpo-15422.

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

    3. pitrou commented on Apr 26, 2014

      @pitrou
      Member

      (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)

    4. asvetlov commented on Apr 28, 2014

      @asvetlov
      Contributor

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

    5. larryhastings commented on Sep 20, 2014

      @larryhastings
      Contributor

      This is still not fixed.

    6. birkenfeld commented on Sep 20, 2014

      @birkenfeld
      Member

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

    7. larryhastings commented on Feb 7, 2015

      @larryhastings
      Contributor

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

    8. pitrou commented on Feb 8, 2015

      @pitrou
      Member

      Perhaps Steve can confirm that the patch is right.

    9. asvetlov commented on Feb 8, 2015

      @asvetlov
      Contributor

      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?

    10. zooba commented on Feb 8, 2015

      @zooba
      Member

      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.

    11. zware commented on Apr 13, 2015

      @zware
      Member

      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.

    12. asvetlov commented on Apr 13, 2015

      @asvetlov
      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\>


    13. python-dev commented on Apr 27, 2015

      python-devmannequin
      Mannequin

      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

    14. asvetlov commented on Apr 27, 2015

      @asvetlov
      Contributor

      Fixed. Sorry for long delay.

    15. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions