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年08月09日 03:43 by eric.snow, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| loader_details.diff | eric.snow, 2012年08月09日 03:43 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg167755 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2012年08月09日 03:43 | |
The path hook associated with importlib.machinery.FileFinder hides away its loader details in a closure. This is less than ideal for the purposes of introspection and general hacking. Here's a simple patch that exposes the loader details as an attribute on the path hook. This came up in issue 15576 (see msg167632). |
|||
| msg167757 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2012年08月09日 04:00 | |
The alternative is this: path_hook.__closure__[1].cell_contents |
|||
| msg167776 - (view) | Author: Chris Jerdonek (chris.jerdonek) * (Python committer) | Date: 2012年08月09日 08:50 | |
It seems like a test and documentation for this would be beneficial (for the usual reasons, etc). |
|||
| msg185283 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2013年03月26日 17:54 | |
The details are no longer in a closure but instead on the _loaders attribute. Why do you want the details exposed? Do you have an actual use-case? |
|||
| msg222838 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2014年07月12日 13:48 | |
@Eric do you wish to take this any further? I'm only asking as Brett's questions in msg185283 are currently unanswered. |
|||
| msg360919 - (view) | Author: Brett Cannon (brett.cannon) * (Python committer) | Date: 2020年01月29日 00:47 | |
Since Eric never replied I'm just closing this. |
|||
| msg360967 - (view) | Author: Eric Snow (eric.snow) * (Python committer) | Date: 2020年01月29日 15:37 | |
I have many other things higher on my todo list. :) I'll re-open this issue if I get back to the project that motivated this (i.e. "source translation via import hooks for filename suffix"). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:34 | admin | set | github: 59805 |
| 2020年01月29日 15:37:00 | eric.snow | set | status: open -> closed resolution: out of date messages: + msg360967 stage: patch review -> resolved |
| 2020年01月29日 00:47:49 | brett.cannon | set | messages: + msg360919 |
| 2019年04月26日 19:05:05 | BreamoreBoy | set | nosy:
- BreamoreBoy |
| 2014年07月12日 13:48:46 | BreamoreBoy | set | status: pending -> open versions: + Python 3.5, - Python 3.4 nosy: + BreamoreBoy messages: + msg222838 |
| 2013年03月26日 17:54:29 | brett.cannon | set | status: open -> pending messages: + msg185283 |
| 2012年08月11日 14:35:28 | Arfrever | set | nosy:
+ Arfrever |
| 2012年08月09日 08:50:29 | chris.jerdonek | set | nosy:
+ chris.jerdonek messages: + msg167776 |
| 2012年08月09日 04:00:40 | eric.snow | set | messages: + msg167757 |
| 2012年08月09日 03:43:20 | eric.snow | create | |