Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue21226

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:PyImport_ExecCodeModuleObject not setting module attributes
Type:behaviorStage:resolved
Components:Library (Lib)Versions:Python 3.3, Python 3.4, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To: eric.snowNosy List: Arfrever, benjamin.peterson, brett.cannon, eric.snow, ncoghlan, python-dev, trevor3
Priority:normalKeywords:patch

Created on2014-04-14 21:04 bytrevor3, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
fix-PyImport_ExecCodeModuleObject.differic.snow,2014-04-19 07:49
fix-PyImport_ExecCodeModuleObject.differic.snow,2014-04-20 00:13
Messages (7)
msg216217 -(view)Author: Trevor Caira (trevor3)Date: 2014-04-14 21:04
InPython/import.c, PyImport_ExecCodeModuleObject creates a new module object but doesn't set all of the attributes required for modules, such as __spec__ or __loader__.This breaks mod_wsgi from 3.3 and up, which depends on PyImport_ExecCodeModuleEx, which delegates to PyImport_ExecCodeModuleObject for its module creation logic. Seehttps://code.google.com/p/modwsgi/source/browse/mod_wsgi/mod_wsgi.c#6289
msg216850 -(view)Author: Eric Snow (eric.snow)*(Python committer)Date: 2014-04-19 07:49
Here's a (currently segfaulting) patch that demonstrates how I'd like to solve this.  Feedback on the approach is welcome. :)  When I get a chance I'll debug the segfault.
msg216864 -(view)Author: Benjamin Peterson (benjamin.peterson)*(Python committer)Date: 2014-04-19 16:53
The last argument to _PyObject_CallMethodIdObjArgs needs to be NULL...
msg216886 -(view)Author: Eric Snow (eric.snow)*(Python committer)Date: 2014-04-20 00:13
Thanks, Benjamin.  Here's an updated patch that passes all tests.  It should be good to go.  And yet again our zipimport implementation was a pain point. :(
msg218161 -(view)Author: Brett Cannon (brett.cannon)*(Python committer)Date: 2014-05-09 12:41
LGTM although you forgot to use a loader instance instead of the class.
msg218391 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2014-05-13 00:27
New changeset7d20e30bd540 by Eric Snow in branch '3.4':Issue#21226: Set all attrs in PyImport_ExecCodeModuleObject.http://hg.python.org/cpython/rev/7d20e30bd540New changesetbc324a49d0fc by Eric Snow in branch 'default':Merge from 3.4 (for#21226).http://hg.python.org/cpython/rev/bc324a49d0fc
msg219356 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2014-05-29 18:44
New changesetbaa7b5555656 by Eric Snow in branch '3.4':Issue#21226: fix a ref leak.http://hg.python.org/cpython/rev/baa7b5555656New changeset57130574d1e8 by Eric Snow in branch 'default':Issue#21226: Merge from 3.4.http://hg.python.org/cpython/rev/57130574d1e8
History
DateUserActionArgs
2022-04-11 14:58:01adminsetgithub: 65425
2014-05-29 18:44:15python-devsetmessages: +msg219356
2014-05-13 00:31:35eric.snowsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2014-05-13 00:27:34python-devsetnosy: +python-dev
messages: +msg218391
2014-05-11 11:57:02Arfreversetnosy: +Arfrever
2014-05-09 12:41:29brett.cannonsetmessages: +msg218161
2014-04-20 00:13:19eric.snowsetfiles: +fix-PyImport_ExecCodeModuleObject.diff

messages: +msg216886
2014-04-19 16:53:09benjamin.petersonsetnosy: +benjamin.peterson
messages: +msg216864
2014-04-19 07:49:57eric.snowsetfiles: +fix-PyImport_ExecCodeModuleObject.diff
messages: +msg216850

assignee:eric.snow
keywords: +patch
stage: patch review
2014-04-14 21:04:27trevor3create
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp