Re: [Python-Dev] Safely importing zip files with C extensions

2013-03-29 Thread Thomas Heller

Am 29.03.2013 02:06, schrieb Gregory P. Smith:


On Thu, Mar 28, 2013 at 9:09 AM, Brett Cannon mailto:[email protected]>> wrote:

On Thu, Mar 28, 2013 at 10:44 AM, Thomas Heller mailto:[email protected]>> wrote:

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.


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.


Once http://sourceware.org/bugzilla/show_bug.cgi?id=11767 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).


For windows there is already code that does it:

http://www.py2exe.org/index.cgi/Hacks/ZipExtImporter

This page is not up-to-date, but it describes the idea and the
implementation.  The code currently is 32-bit only and for Python 2
but that probably can be fixed.

It is based on Joachim Bauch's MemoryModule:
https://github.com/fancycode/MemoryModule


Thomas

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Summary of Python tracker Issues

2013-03-29 Thread Python tracker

ACTIVITY SUMMARY (2013-03-22 - 2013-03-29)
Python tracker at http://bugs.python.org/

To view or respond to any of the issues listed below, click on the issue.
Do NOT respond to this message.

Issues counts and deltas:
  open3887 (-21)
  closed 25461 (+72)
  total  29348 (+51)

Open issues with patches: 1724 


Issues opened (46)
==

#6671: webbrowser doesn't respect xfce default browser
http://bugs.python.org/issue6671  reopened by eric.araujo

#17295: __slots__ on PyVarObject subclass
http://bugs.python.org/issue17295  reopened by haypo

#17523: Additional tests for the os module.
http://bugs.python.org/issue17523  opened by willweaver

#17525: os.getcwd() fails on cifs share
http://bugs.python.org/issue17525  opened by dcuddihy

#17526: inspect.findsource raises undocumented error for code objects 
http://bugs.python.org/issue17526  opened by Nils.Bruin

#17527: PATCH as valid request method in wsgiref.validator
http://bugs.python.org/issue17527  opened by lsbardel

#17528: Implement dumps/loads for lru_cache
http://bugs.python.org/issue17528  opened by frafra

#17529: fix os.sendfile() documentation regarding the type of file des
http://bugs.python.org/issue17529  opened by neologix

#17530: pprint could use line continuation for long bytes literals
http://bugs.python.org/issue17530  opened by pitrou

#17532: IDLE: Always include "Options" menu on MacOSX
http://bugs.python.org/issue17532  opened by roger.serwy

#17533: test_xpickle fails with "cannot import name precisionbigmemtes
http://bugs.python.org/issue17533  opened by ned.deily

#17534: unittest keeps references to test cases alive
http://bugs.python.org/issue17534  opened by ezio.melotti

#17535: IDLE: Add an option to show line numbers along the left side o
http://bugs.python.org/issue17535  opened by Todd.Rovito

#17536: update browser list with additional browser names
http://bugs.python.org/issue17536  opened by doko

#17537: csv.DictReader should fail if >1 column has the same name
http://bugs.python.org/issue17537  opened by doko

#17538: Document XML Vulnerabilties
http://bugs.python.org/issue17538  opened by dstufft

#17539: Use the builtins module in the unittest.mock.patch example
http://bugs.python.org/issue17539  opened by berker.peksag

#17540: logging formatter support 'style' key in dictionary config
http://bugs.python.org/issue17540  opened by monson

#17544: regex code re-raises exceptions on success
http://bugs.python.org/issue17544  opened by Zdeněk.Pavlas

#17545: os.listdir and os.path.join inconsistent on empty path
http://bugs.python.org/issue17545  opened by babou

#17546: Document the circumstances where the locals() dict gets update
http://bugs.python.org/issue17546  opened by techtonik

#17547: "checking whether gcc supports ParseTuple __format__... " erro
http://bugs.python.org/issue17547  opened by dmalcolm

#17548: unittest.mock: test_create_autospec_unbound_methods is skipped
http://bugs.python.org/issue17548  opened by haypo

#17549: Some exceptions not highlighted in exceptions documentation.
http://bugs.python.org/issue17549  opened by Ramchandra Apte

#17551: Windows - accessing drive with nothing mounted forces user int
http://bugs.python.org/issue17551  opened by bobjalex

#17552: socket.sendfile()
http://bugs.python.org/issue17552  opened by giampaolo.rodola

#17553: Note that distutils’ bdist_rpm command is not used to build 
http://bugs.python.org/issue17553  opened by Sean.Carolan

#17554: Compact output for regrtest
http://bugs.python.org/issue17554  opened by ezio.melotti

#17555: Creating new processes after importing multiprocessing.manager
http://bugs.python.org/issue17555  opened by Marc.Brünink

#17557: test_getgroups of test_posix can fail on OS X 10.8 if more tha
http://bugs.python.org/issue17557  opened by ned.deily

#17558: gdb debugging python frames in optimised interpreters
http://bugs.python.org/issue17558  opened by mcobden

#17560: problem using multiprocessing with really big objects?
http://bugs.python.org/issue17560  opened by mrjbq7

#17561: Add socket.create_server_sock() convenience function
http://bugs.python.org/issue17561  opened by giampaolo.rodola

#17563: Excessive resizing of dicts when used as a cache
http://bugs.python.org/issue17563  opened by Mark.Shannon

#17564: test_urllib2_localnet fails
http://bugs.python.org/issue17564  opened by Mark.Shannon

#17565: segfaults during serialization
http://bugs.python.org/issue17565  opened by eddiewrc

#17566: Document that importlib.abc.Loader.module_repr is abstract and
http://bugs.python.org/issue17566  opened by brett.cannon

#17567: Clarify importlib.abc.PathEntryFinder.find_loader() docs
http://bugs.python.org/issue17567  opened by brett.cannon

#17568: re: Infinite loop with repeated empty alternative
http://bugs.python.org/issue17568  opened by ericp

#17569: urllib2 urlopen truncates https pages after 32768 characters
http://bugs.python.org/issue17569  opened by jhp7e

#17570: Improve devguide Wind

Re: [Python-Dev] Writing importers and path hooks

2013-03-29 Thread Nick Coghlan
On Fri, Mar 29, 2013 at 3:39 AM, Brett Cannon  wrote:
> To tell if a module is a package, you should do either ``if mod.__name__ ==
> mod.__package__`` or ``if hasattr(mod, '__path__')``.

The second of those is actually a bit more reliable. As with many
import quirks, the answer to "But why?" is "Because __main__" :P

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Accepting PEP 434, Idle Enhancement Exception

2013-03-29 Thread Nick Coghlan
I am accepting Todd Rovito's and Terry Reedy's PEP 434, officially
declaring IDLE to be an application bundled with Python, with the
contents of "Lib/idlelib" exempt from the usual "no new features in
maintenance releases" rule.

As stated in the PEP, this isn't carte blanche to do major rewrites in
maintenance releases, merely acknowledgement that, when in doubt, we
better serve our users by treating IDLE as a bundled application and
making it behave consistently across all supported versions than we do
by treating it as a library first and an application second.

Hopefully this clarification, and the stated goal of supporting IDLE
as a high quality cross-platform default starting point for new Python
users that aren't already accustomed to the command line and editing
text files directly, will make it easier for the IDLE developers to
focus on making IDLE excel at that task.

Regards,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Accepting PEP 434, Idle Enhancement Exception

2013-03-29 Thread Maciej Fijalkowski
On Fri, Mar 29, 2013 at 6:33 PM, Nick Coghlan  wrote:
> I am accepting Todd Rovito's and Terry Reedy's PEP 434, officially
> declaring IDLE to be an application bundled with Python, with the
> contents of "Lib/idlelib" exempt from the usual "no new features in
> maintenance releases" rule.
>
> As stated in the PEP, this isn't carte blanche to do major rewrites in
> maintenance releases, merely acknowledgement that, when in doubt, we
> better serve our users by treating IDLE as a bundled application and
> making it behave consistently across all supported versions than we do
> by treating it as a library first and an application second.
>
> Hopefully this clarification, and the stated goal of supporting IDLE
> as a high quality cross-platform default starting point for new Python
> users that aren't already accustomed to the command line and editing
> text files directly, will make it easier for the IDLE developers to
> focus on making IDLE excel at that task.
>
> Regards,
> Nick.

Does that mean that mainstream idle development should move out of the
python tree?
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Accepting PEP 434, Idle Enhancement Exception

2013-03-29 Thread Todd Rovito
On Fri, Mar 29, 2013 at 10:40 PM, Maciej Fijalkowski wrote:

> Does that mean that mainstream idle development should move out of the
> python tree?


No the acceptance of PEP-434 does not mean IDLE development should move out
of the python tree.  The acceptance of PEP-434 means that the restriction
on applying enhancements be relaxed for IDLE code residing in
../Lib/idlelib.  In other words Python Core Developers can apply
enhancements (but not major rewrites) even to the 2.7 branch. The
relaxation was requested in the hope that we can apply many of the already
existing patches quickly and allow IDLE to become a high quality
cross-platform default starting point for new Python users that aren't
already accustomed to the command line and editing text files directly.
 PEP-434 doesn't suggest moving the IDLE code outside of the Python tree.
 Please let me know if you have additional questions, feel free to help us
with IDLE development!
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Accepting PEP 434, Idle Enhancement Exception

2013-03-29 Thread Nick Coghlan
On Sat, Mar 30, 2013 at 12:40 PM, Maciej Fijalkowski  wrote:
> On Fri, Mar 29, 2013 at 6:33 PM, Nick Coghlan  wrote:
>> I am accepting Todd Rovito's and Terry Reedy's PEP 434, officially
>> declaring IDLE to be an application bundled with Python, with the
>> contents of "Lib/idlelib" exempt from the usual "no new features in
>> maintenance releases" rule.
>>
>> As stated in the PEP, this isn't carte blanche to do major rewrites in
>> maintenance releases, merely acknowledgement that, when in doubt, we
>> better serve our users by treating IDLE as a bundled application and
>> making it behave consistently across all supported versions than we do
>> by treating it as a library first and an application second.
>>
>> Hopefully this clarification, and the stated goal of supporting IDLE
>> as a high quality cross-platform default starting point for new Python
>> users that aren't already accustomed to the command line and editing
>> text files directly, will make it easier for the IDLE developers to
>> focus on making IDLE excel at that task.
>>
>> Regards,
>> Nick.
>
> Does that mean that mainstream idle development should move out of the
> python tree?

That will ultimately be up to the IDLE developers. However, I don't
expect it to happen any time soon, as remaining in the CPython repo
allows them to easily re-use the existing buildbot fleet as they try
to build out a decent test suite, and also means they don't have to
spend their time working out a completely new development workflow
rather than working on IDLE as it exists now.

Past experience also suggests that maintaining things in the CPython
repo and cutting periodic external releases (if the IDLE developers
ever choose to do that) works a *lot* better than trying to
periodically reintegrate an externally maintained tool.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Accepting PEP 434, Idle Enhancement Exception

2013-03-29 Thread Simon Cross
Having a standalone version of IDLE might be really useful to
alternative Python implementations.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com