[Patches] [ python-Patches-492105 ] Import from Zip archive
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 15 Aug 2002 07:44:07 -0700
Patches item #492105, was opened at 2001-12-12 17:21
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=492105&group_id=5470
Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: Out of Date
Priority: 5
Submitted By: James C. Ahlstrom (ahlstromjc)
Assigned to: Neal Norwitz (nnorwitz)
Summary: Import from Zip archive
Initial Comment:
This is the "final" patch to support imports from zip
archives, and directory caching using os.listdir(). It
replaces patch 483466 and 476047. It is a separate
patch since I can't delete file attachments. It adds
support for importing from "" and from relative paths.
----------------------------------------------------------------------
>Comment By: James C. Ahlstrom (ahlstromjc)
Date: 2002-08-15 14:44
Message:
Logged In: YES
user_id=64929
Here is the import.c diff -c against Python-2.2.1.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-08-15 14:20
Message:
Logged In: YES
user_id=6380
I think a new patch just for import.c would be helpful.
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2002-08-15 14:09
Message:
Logged In: YES
user_id=33168
James, could you look at what Guido reworked? If that is
fine, I can push it forward. Otherwise, feel free to update
the patch. If I do any work on it, I'll make comments here
so we don't duplicate work. Thanks.
----------------------------------------------------------------------
Comment By: James C. Ahlstrom (ahlstromjc)
Date: 2002-08-15 13:37
Message:
Logged In: YES
user_id=64929
This patch is old. I can provide a new patch against Python
2.2.1 if that would help. Or a new patch just for import.c
against 2.2.1.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-08-15 02:40
Message:
Logged In: YES
user_id=6380
No, the failing hunk is included in dashc-2. I actually
*edited* the patch file until all but that one hunk succeeded.
Thanks for looking into this! If you need help don't fail to
ask on python-dev, I read it daily. :-)
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2002-08-15 01:38
Message:
Logged In: YES
user_id=33168
Reassigning to me. I'll give it a shot. It will take a
while. Do I understand you correctly that your updated
patch (dashc-2) has all the necessary pieces, except for the
import hunk 11 that was rejected? And I need to get that
failed hunk from the original patch?
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-08-15 01:32
Message:
Logged In: YES
user_id=6380
Whoa... That's a lot. Neal, do you think you could come up
with a reworked version of this? That would be great!
----------------------------------------------------------------------
Comment By: Neal Norwitz (nnorwitz)
Date: 2002-08-14 23:30
Message:
Logged In: YES
user_id=33168
I'm reviewed most of the updated version. Quick summary:
* strncpy() doesn't null terminate strings, this needs to
be added
* seems to be many leaked references
Here are more details:
* strncpy(dest, str, size) doesn't guarantee the result to
be null terminated,
need dest[size] = '\0'; after all strncpy()s (I see a
bunch in getpath.c)
* getpath.c:get_sys_path_0(), I think some compilers warn
when you do char[i] = 0; (use '\0' instead)
(there may be other places of this)
* import.c:PyImport_InitZip(), have_zlib is an alias to
zlib and isn't really helpful/necessary
* import.c:get_path_type() can leak a reference to pyobj if
it's an int
* import.c:add_directory_names() pylist reference is leaked
* import.c:add_zip_names(), memcmp(path+i, ".zip", 4) is
clearer to me than path[i] == '.' ....
* import.c:add_zip_names, there's a lot of magic #s in this
function
* " " : leak refs when doing PyTuple_SetItem
I think there were other leaked references. I'll try to
spend some more time later.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2002-08-14 20:50
Message:
Logged In: YES
user_id=6380
Sigh. We waited too long for this one, and now the patch is
hopelessly out of date. I managed to fix most of the
failing hunks, but the remaining hunk that fails (#11 in
import.c) is a whopper: the saved import.c.rej is 270 lines
long.
I'm going to sleep on that, but I could use some help.
In the mean time, I'm uploading an edited version of
dashc.diff to help the next person.
----------------------------------------------------------------------
Comment By: Martin v. Löwis (loewis)
Date: 2002-07-28 10:54
Message:
Logged In: YES
user_id=21627
Is this patch ready to be applied?
----------------------------------------------------------------------
Comment By: Jeremy Hylton (jhylton)
Date: 2002-06-12 15:05
Message:
Logged In: YES
user_id=31392
Deleteing the old diffs that Jim couldn't delete.
----------------------------------------------------------------------
Comment By: James C. Ahlstrom (ahlstromjc)
Date: 2002-03-15 17:27
Message:
Logged In: YES
user_id=64929
I added a diff -c version of the patch.
----------------------------------------------------------------------
Comment By: James C. Ahlstrom (ahlstromjc)
Date: 2002-03-15 17:03
Message:
Logged In: YES
user_id=64929
I still can't delete files, but I added a new file which
contains all diffs as a single file, and is made from the
current CVS tree (Mar 15, 2002).
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=492105&group_id=5470