Bug 1035397

Summary: SystemError: Bad call flags in PyCFunction_Call. METH_OLDARGS is no longer supported!
Product: [Fedora] Fedora Reporter: Jindrich Luza <jluza>
Component: python3Assignee: Charalampos Stratakis <cstratak>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 22CC: amcnabb, bkabrda, jberan, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 18:50:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jindrich Luza 2013-11-27 16:27:08 UTC
Description of problem:
Calling bindings method defined like this:

    {"xml_f", (PyCFunction)PyCOMPS_toxml_f, METH_KEYWORDS,
    "write XML represenstation of COMPS to file"},

causes:
    SystemError: Bad call flags in PyCFunction_Call. METH_OLDARGS is no longer
                 supported!

Version-Release number of selected component (if applicable):
3.3.2-8

Howto fix:
There's typo in Python-3.3.2/Objects/methodobject.c on line 83:
    case METH_VARARGS | METH_KEYWORDS:

and should be of course:
    case METH_VARARGS || METH_KEYWORDS:

Comment 1 Jindrich Luza 2013-11-27 16:47:24 UTC
I was wrong. There's some binary magic in PyCFunction_Call

Comment 2 Bohuslav "Slavek" Kabrda 2013-11-29 14:10:51 UTC
It seems there is a very similar issue already reported upstream [1]. Just from top of my head, shouldn't you use PyCFunctionWithKeywords with METH_KEYWORDS [2]?

[1] http://bugs.python.org/issue11587
[2] http://docs.python.org/3/c-api/structures.html#METH_KEYWORDS

Comment 3 Bohuslav "Slavek" Kabrda 2013-11-29 14:18:57 UTC
Ah, I was wrong, too :)
Seems that this indeed is an issue, as reported yet elsewhere [1]. The proper short term solution seems to be using "METH_VARARGS | METH_KEYWORDS". Is that possible for you? I'd like to wait for the upstream to fix this so that Fedora doesn't deviate from the vanilla Python behaviour.

[1] http://bugs.python.org/issue15657

Comment 4 Jindrich Luza 2013-12-02 11:57:30 UTC
Yes, I figured it out too. Wait for upstream will be probably the best. But I was really suprised when my code suddenly doesn't work and when I trying to find solution, I found only some bugs for 3.0.x reported quite long time ago and there wasn't any progress on them. So I rather report bug here, because of planned python3 default version for fedora 21 so as people could find solution here (even temporal).

Comment 5 Jaroslav Reznik 2015-03-03 16:57:12 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 6 Fedora Admin XMLRPC Client 2015-05-12 12:02:51 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 7 Fedora Admin XMLRPC Client 2016-01-29 13:07:57 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 8 Fedora End Of Life 2016-07-19 18:50:56 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.