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

2013-03-28 Thread Gregory P. Smith
On Thu, Mar 28, 2013 at 9:09 AM, Brett Cannon wrote: > > > > On Thu, Mar 28, 2013 at 10:44 AM, Thomas Heller wrote: > >> Am 27.03.2013 20:38, schrieb Vinay Sajip: >> >> This quote is here to stop GMane complaining that I'm top-posting. Ignore. >>> >>> I've already posted this to distut

Re: [Python-Dev] [Python-checkins] cpython (2.7): Issue 17538: Document XML vulnerabilties

2013-03-28 Thread Ezio Melotti
Hi, On Tue, Mar 26, 2013 at 6:53 PM, christian.heimes wrote: > http://hg.python.org/cpython/rev/e87364449954 > changeset: 82973:e87364449954 > branch: 2.7 > parent: 82963:d321885ff8f3 > user:Christian Heimes > date:Tue Mar 26 17:53:05 2013 +0100 > summary: > Issue 1

Re: [Python-Dev] Can I introspect/reflect to get arguments exec()?

2013-03-28 Thread PJ Eby
On Thu, Mar 28, 2013 at 6:43 AM, Rocky Bernstein wrote: > Of course the debugger uses sys.settrace too, so the evil-ness of that is > definitely not a concern. But possibly I need to make sure that since the > DecoratorTools and the debugger both hook into trace hooks they play nice > together and

Re: [Python-Dev] noob contributions to unit tests

2013-03-28 Thread Walter Dörwald
Am 27.03.2013 um 03:24 schrieb R. David Murray : > On Tue, 26 Mar 2013 16:59:06 -0700, Maciej Fijalkowski > wrote: >> On Tue, Mar 26, 2013 at 4:49 PM, Sean Felipe Wolfe >> wrote: >>> Hey everybody how are you all :) >>> >>> I am an intermediate-level python coder looking to get help out. I'v

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

2013-03-28 Thread Brett Cannon
On Thu, Mar 28, 2013 at 12:33 PM, Paul Moore wrote: > On 28 March 2013 16:08, Brett Cannon wrote: > > You only need SourceLoader since you are dealing with Python source. You > > don't need FileLoader since you are not reading from disk but an > in-memory > > zipfile. > > > > You should be imple

Re: [Python-Dev] noob contributions to unit tests

2013-03-28 Thread Daniel Wozniak
Sean, During the PyCon sprints I was helping work on unittests in urllib. I think as it stands right now urllib/error.py and urllib/parse.py are at 100% line coverage. I have some additions to urllib/request.py which I have yet to submit a patch for (anything above line 700 is covered thus fa

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

2013-03-28 Thread Christian Heimes
Am 28.03.2013 17:09, schrieb Brett Cannon: > 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. Cleanup is going to be tricky or even impossible. Windows locks loaded DLLs and therefore prevents their re

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

2013-03-28 Thread Paul Moore
On 28 March 2013 16:08, Brett Cannon wrote: > You only need SourceLoader since you are dealing with Python source. You > don't need FileLoader since you are not reading from disk but an in-memory > zipfile. > > You should be implementing get_data, get_filename, and path_stats for > SourceLoader.

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

2013-03-28 Thread Brett Cannon
On Thu, Mar 28, 2013 at 10:44 AM, Thomas Heller wrote: > Am 27.03.2013 20:38, schrieb Vinay Sajip: > > This quote is here to stop GMane complaining that I'm top-posting. Ignore. >>> >> >> I've already posted this to distutils-sig, but thought that it might be of >> interest to readers here as it

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

2013-03-28 Thread Brett Cannon
On Thu, Mar 28, 2013 at 11:38 AM, Paul Moore wrote: > On 28 March 2013 13:42, Brett Cannon wrote: > >> importer, as I wanted to try a proof of concept importer based on the > >> new importlib stuff (which is intended to make writing custom > >> importers easier), and I really struggled to get so

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

2013-03-28 Thread Paul Moore
On 28 March 2013 13:42, Brett Cannon wrote: >> importer, as I wanted to try a proof of concept importer based on the >> new importlib stuff (which is intended to make writing custom >> importers easier), and I really struggled to get something working. > > Struggling how? With the finder? The load

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

2013-03-28 Thread Thomas Heller
Am 27.03.2013 20:38, schrieb Vinay Sajip: This quote is here to stop GMane complaining that I'm top-posting. Ignore. I've already posted this to distutils-sig, but thought that it might be of interest to readers here as it relates to importing C extensions ... zipimport is great, but there can

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

2013-03-28 Thread Brett Cannon
On Wed, Mar 27, 2013 at 6:59 PM, Paul Moore wrote: > On 27 March 2013 21:19, Bradley M. Froehle wrote: > > I implemented just such a path hook zipimporter plus the magic > required > > for C extensions --- as a challenge to myself to learn more about the > Python > > import mechanisms. > >

Re: [Python-Dev] Can we triple quoted string as a comment?

2013-03-28 Thread Xavier de Gaye
On Tue, Mar 26, 2013 at 2:28 PM, R. David Murray wrote: > On Mon, 25 Mar 2013 18:16:47 -0700, Raymond Hettinger wrote: >> If you're editing with Emacs, it is really easy to reflow paragraphs >> and to insert or remove multiline comments each prefixed with #. >> But with other editors, it can be a P

Re: [Python-Dev] Can I introspect/reflect to get arguments exec()?

2013-03-28 Thread Rocky Bernstein
Thank you for your very thoughtful and detailed explanation of what is going on and for your considerations as to how to get this done (as opposed to why it *can't *be done). It looks like DecoratorTools or more likely a customized version of it is the way to go! (The important info is above. The