Message147881
| Author |
scoder |
| Recipients |
scoder |
| Date |
2011年11月18日.15:46:57 |
| SpamBayes Score |
7.6339894e-08 |
| Marked as misclassified |
No |
| Message-id |
<1321631218.51.0.537222078649.issue13429@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
In Python modules, the top-level module code sees the __file__ variable and can use it to refer to resources in package subdirectories, for example. This is not currently possible in extension modules, because __file__ is only set after running the module init function, and the module has no way to find out its runtime location.
CPython should set __file__ directly in PyModule_Create2(), based on information provided by the shared library loader. This would let PyModule_GetFilenameObject() work immediately with the newly created module object.
The relevant python-dev thread is here:
http://mail.python.org/pipermail/python-dev/2011-November/114476.html
A patch will follow soon. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年11月18日 15:46:58 | scoder | set | recipients:
+ scoder |
| 2011年11月18日 15:46:58 | scoder | set | messageid: <1321631218.51.0.537222078649.issue13429@psf.upfronthosting.co.za> |
| 2011年11月18日 15:46:57 | scoder | link | issue13429 messages |
| 2011年11月18日 15:46:57 | scoder | create |
|