[issue17630] Create a pure Python zipfile/tarfile importer

2015-04-13 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Based on our hallway pow-wow at PyCon 2015 sprints day #1...  I audited the 
zipfile module to confirm our suspicions about it being large.

In current Python 3.5 head's zipfile.py module here are the things it depends 
directly upon from other modules:

import io  # [Py(C: _io)] io.BufferedIOBase{,readline}, io.BytesIO, io.open
import os  # [Py(C: various)] os.path.*, os.getcwd, os.stat, os.listdir, 
curdir, pardir, 
import re  # [Py(C: sre_*)] Only used for universal newlines in 
ZipExtFile.readline().  Shouldn't the io module do this part for us?!?
import importlib.util  # [Py] importib.util.cache_from_source() from PyZipFile 
to create importable .zip files.
import sys  # [C] sys.platform for creation metadata, sys.stderr for a strange 
print on a DeprecationWarning.
import time  # [C] time.localtime, time.time
import stat  # [Py] stat.filemode, stst.S_ISDIR
import shutil  # [Py] shutil.copyfileobj() from _extract_member().
import struct  # [Py(C: _struct)] struct.pack(), struct.unpack(), 
struct.calcsize()
import binascii  # [C] binascii.crc32() only if zlib is unavailable. (store 
only zip support?)
import threading  # [Py] threading.RLock() in ZipFile.

import zlib, bz2, lzma are all conditional.  # [C]

import warnings  # [Py] conditional import to highlight legacy uses.
import py_compile  # [Py] conditional import in PyZipFile for importable .zip 
file creation.

Some of these are obviously shims around C extensions which could conditionally 
be used directly if desired.  But many others are largely implemented in 
Python.  Freezing all of these just to use the bloated zipfile.py within a pure 
Python zipimport implementation seems like extreme overkill.  Not worth the 
effort.

Efforts for improved zipimport are now likely to focus on a simple C zip file 
reading-only library being used by a new clean implementation of a zip importer 
on top of that.

--
nosy: +gregory.p.smith

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17630
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17630] Create a pure Python zipfile/tarfile importer

2015-04-13 Thread Gregory P. Smith

Changes by Gregory P. Smith g...@krypto.org:


--
resolution:  - rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17630
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17630] Create a pure Python zipfile/tarfile importer

2014-02-26 Thread Brett Cannon

Brett Cannon added the comment:

The more I think about this, the less useful it seems to be. We need zipimport 
written in C for bootstrapping issues. If that's the case then time should be 
put into making that work and not duplicating the functionality. I'm going to 
leave this open but unassign from myself as I would rather focus on my lazy 
loader issue than this. If someone can manage to create a zipfile importer 
whose dependencies are small and thus can be frozen along with importlib then 
this can be moved forward.

--
assignee: brett.cannon - 

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17630
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17630] Create a pure Python zipfile/tarfile importer

2014-01-22 Thread Brett Cannon

Brett Cannon added the comment:

Re-positioning to work with both tarfile and zipfile since tarfile's 'r' will 
transparently decompress as necessary. Might need to scale back some 
functionality to make it easily work with both formats. But since are both 
alternative storage solutions then some generic base classes should be possible 
(which might require some refactoring anyway to make it all abstract in 
comparison to the storage mechanism.

--
title: Create a pure Python zipfile importer - Create a pure Python 
zipfile/tarfile importer

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17630
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com