Showing content from http://mail.python.org/pipermail/python-dev/attachments/20130328/1d252a7d/attachment.html below:
<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 28, 2013 at 9:09 AM, Brett Cannon <span dir="ltr"><<a href="mailto:brett@python.org" target="_blank">brett@python.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">
<div class="im">On Thu, Mar 28, 2013 at 10:44 AM, Thomas Heller <span dir="ltr"><<a href="mailto:theller@ctypes.org" target="_blank">theller@ctypes.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Am <a href="tel:27.03.2013%2020" value="+12703201320" target="_blank">27.03.2013 20</a>:38, schrieb Vinay Sajip:<div>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
This quote is here to stop GMane complaining that I'm top-posting. Ignore.<br>
</blockquote>
<br>
I've already posted this to distutils-sig, but thought that it might be of<br>
interest to readers here as it relates to importing C extensions ...<br>
<br>
zipimport is great, but there can be issues importing software that contains<br>
C extensions. But the new wheel format (PEP 427) may give us a better way of<br>
importing zip files containing C extensions. Since wheels are .zip files, they<br>
can sometimes be used to provide functionality without needing to be installed.<br>
But whereas .zip files contain no convention for indicating compatibility with<br>
a particular Python, wheels do contain this compatibility information. Thus, it<br>
is possible to check if a wheel can be directly imported from, and the wheel<br>
support in distlib allows you to take advantage of this using the mount() and<br>
unmount() methods. When you mount a wheel, its absolute path name is added to<br>
sys.path, allowing the Python code in it to be imported. (A DistlibException is<br>
raised if the wheel isn't compatible with the Python which calls the mount()<br>
method.)<br>
</blockquote>
<br></div>
The zip-file itself could support importing compiled extensions when it contains a python-wrapper module that unpacks the .so/.dll file somewhere, and finally calls imp.load_dynamic() to import it and replace itself.</blockquote>
<div><br></div></div><div>Which must be done carefully to prevent a security issue. It shouldn't be unzipped anywhere but into a directory only writable by the process. </div></div></div></div>
<br></blockquote><div><br></div><div style>Once <a href="http://sourceware.org/bugzilla/show_bug.cgi?id=11767">http://sourceware.org/bugzilla/show_bug.cgi?id=11767</a> is implemented and available in libc, no extraction of .so's should be needed (they will likely need to be stored uncompressed in the .zip file for that though).</div>
</div></div></div>
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4