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.
Created on 2012年09月10日 12:04 by paul.moore, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 16324 | closed | AmanPriyanshu, 2019年09月21日 22:21 | |
| Messages (7) | |||
|---|---|---|---|
| msg170178 - (view) | Author: Paul Moore (paul.moore) * (Python committer) | Date: 2012年09月10日 12:04 | |
imp.load_module appears to have a regression - the file argument is not allowed to be None when loading a C_EXTENSION. The pywin32 post-install script for version 217 calls imp.load_module for a C extension with file=None, so presumably this worked in earlier versions. Note that apparently pywin32 tip no longer calls load_module in this way, and load_module is marked as deprecated in the documentation, so it is not clear if this issue actually needs fixing. See #15828 for some background. |
|||
| msg170185 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年09月10日 13:01 | |
How can you load a C extension without a file path? Are C extensions being inappropriately flagged as built-in modules on Windows? What does imp.find_module() return for the module being checked? I need more debugging info on what imp.find_module() and imp.load_module() returns in 3.2 and 3.3 before I can make a call on where the actual breakage is. |
|||
| msg170186 - (view) | Author: Paul Moore (paul.moore) * (Python committer) | Date: 2012年09月10日 13:03 | |
It's the open file object argument, not the path. I assume that if you supplied None, the code opened the file for you. |
|||
| msg170198 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2012年09月10日 16:04 | |
Well, that's extremely annoying as that doesn't work for .py or .pyc files::
>>> import imp
>>> stuff = imp.find_module('blah')
>>> stuff
(<_io.TextIOWrapper name=4 mode='U' encoding='utf-8'>, 'blah.py', ('.py', 'U', 1))
>>> stuff[0].close()
>>> imp.load_module('blah', None, 'blah.py', stuff[2])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: file object required for import (type code 1)
I really hate these functions.
|
|||
| msg188302 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年05月03日 14:47 | |
New changeset c0a21617dbee by Brett Cannon in branch '3.3': Issue #15902: Fix imp.load_module() to accept None as a file when http://hg.python.org/cpython/rev/c0a21617dbee New changeset 322c556260d5 by Brett Cannon in branch 'default': #15902: merge w/ 3.3 http://hg.python.org/cpython/rev/322c556260d5 |
|||
| msg188308 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2013年05月03日 17:13 | |
Leaving it up to the release manager to decide if this is worth cherrypicking or just waiting for the next bugfix release. |
|||
| msg188440 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2013年05月05日 12:42 | |
http://hg.python.org/cpython/rev/996a937cdf81 also applies to this. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:35 | admin | set | github: 60106 |
| 2019年09月23日 17:41:23 | brett.cannon | set | nosy:
- brett.cannon |
| 2019年09月21日 22:21:29 | AmanPriyanshu | set | pull_requests: + pull_request15903 |
| 2013年05月12日 09:41:35 | georg.brandl | set | status: open -> closed |
| 2013年05月05日 12:42:10 | brett.cannon | set | messages: + msg188440 |
| 2013年05月03日 17:16:17 | brett.cannon | set | nosy: brett.cannon, georg.brandl, paul.moore, ncoghlan, larry, Arfrever, python-dev, eric.snow |
| 2013年05月03日 17:13:41 | brett.cannon | set | status: closed -> open priority: normal -> release blocker nosy: + larry messages: + msg188308 |
| 2013年05月03日 14:53:18 | brett.cannon | set | status: open -> closed stage: resolved resolution: fixed versions: + Python 3.4 |
| 2013年05月03日 14:47:27 | python-dev | set | nosy:
+ python-dev messages: + msg188302 |
| 2013年03月26日 18:08:02 | brett.cannon | set | assignee: brett.cannon |
| 2012年09月10日 19:23:02 | Arfrever | set | nosy:
+ Arfrever |
| 2012年09月10日 16:04:19 | brett.cannon | set | nosy:
+ eric.snow |
| 2012年09月10日 16:04:02 | brett.cannon | set | messages: + msg170198 |
| 2012年09月10日 13:03:23 | paul.moore | set | status: pending -> open messages: + msg170186 |
| 2012年09月10日 13:01:50 | brett.cannon | set | status: open -> pending messages: + msg170185 |
| 2012年09月10日 12:04:49 | paul.moore | create | |