Re: [Python-Dev] zipimport

2015-06-04 Thread Nick Coghlan
On 4 June 2015 at 12:10, Rose Ames wrote: > Sounds like I can just add a zipimporter to Lib/importlib/_bootstrap.py and > remove zipimport.c entirely, is that right? We moved things around a bit for 3.5, so this would be in Lib/importlib/_bootstrap_external.py now. My vague recollection is that

Re: [Python-Dev] zipimport

2015-06-03 Thread Rose Ames
On 06/03/2015 08:56 AM, Antoine Pitrou wrote: Le 03/06/2015 14:34, Rose Ames a écrit : On 06/03/2015 04:59 AM, Antoine Pitrou wrote: On Tue, 02 Jun 2015 21:20:10 + Brett Cannon wrote: I vaguely remember people suggesting writing the minimal zip reading code in C but I can't remember wh

Re: [Python-Dev] zipimport

2015-06-03 Thread Brett Cannon
On Wed, Jun 3, 2015 at 5:00 AM Antoine Pitrou wrote: > On Tue, 02 Jun 2015 21:20:10 + > Brett Cannon wrote: > > > > I vaguely remember people suggesting writing the minimal zip reading code > > in C but I can't remember why since we have I/O access in importlib > through > > _io and thus it'

Re: [Python-Dev] zipimport

2015-06-03 Thread Antoine Pitrou
On Tue, 02 Jun 2015 21:20:10 + Brett Cannon wrote: > > I vaguely remember people suggesting writing the minimal zip reading code > in C but I can't remember why since we have I/O access in importlib through > _io and thus it's really just the pulling apart of the zip file to get at > the file

Re: [Python-Dev] zipimport to read from a file object instead of just a path?

2012-05-15 Thread Shy Shalom
> > It's already possible - just write another importer. For the builtin > zipimport, this is not an option, since it seeds itself from the sys.path > entry, which will be a file name. See PEP 302. > > Regards, > Martin > > Maybe it can be seeded by both a string path *or* a file object, the

Re: [Python-Dev] zipimport to read from a file object instead of just a path?

2012-05-15 Thread martin
Zitat von Shy Shalom : In zipimport.c, function get_data(), the zip file is opened using fopen() and read with CLib functions. Did anyone ever consider making it possible to read the zipped data from a generic file object and not just using a string path? It's already possible - just write an

[Python-Dev] zipimport to read from a file object instead of just a path?

2012-05-15 Thread Shy Shalom
In zipimport.c, function get_data(), the zip file is opened using fopen() and read with CLib functions. Did anyone ever consider making it possible to read the zipped data from a generic file object and not just using a string path? Using StringIO, This would allow a higher degree of python embeddi