RE: Copying a ZipExtFile

2009-10-29 Thread Moore, Mathew L
> On October 28, 2009 8:33 PM, "ryles" wrote: > > > with io.BytesIO() as memio: > > shutil.copyfileobj(f, memio) > > zip = zipfile.ZipFile(file=memio) > > # Can't use zip.extract(), because I want to ignore paths > > # within archive. > > src = zip.open(

Re: Copying a ZipExtFile

2009-10-28 Thread ryles
On Oct 28, 8:33 pm, ryles wrote: > As for why the bytesToRead calculation in ZipExtFile.read() results in > a long, I've not yet looked at it closely. Simple, actually: In ZipExtFile.__init__(): self.bytes_read = 0L In ZipExitFile.read(): bytesToRead = self.compress_size - self.bytes_

Re: Copying a ZipExtFile

2009-10-28 Thread ryles
On Oct 23, 1:15 pm, "Moore, Mathew L" wrote: > Hello all, > > A newbie here.  I was wondering why the following fails on Python 2.6.2 > (r262:71605) on win32.  Am I doing something inappropriate? > > Interestingly, it works in 3.1, but would like to also get it working in 2.6. > > Thanks in advan

RE: Copying a ZipExtFile

2009-10-26 Thread Moore, Mathew L
> En Fri, 23 Oct 2009 14:15:33 -0300, Moore, Mathew L > > escribió: > > > with io.BytesIO() as memio: > > shutil.copyfileobj(f, memio) > > zip = zipfile.ZipFile(file=memio) > > # Can't use zip.extract(), because I want to ignore paths > > # within archive. > >

Re: Copying a ZipExtFile

2009-10-23 Thread Gabriel Genellina
En Fri, 23 Oct 2009 14:15:33 -0300, Moore, Mathew L escribió: with io.BytesIO() as memio: shutil.copyfileobj(f, memio) zip = zipfile.ZipFile(file=memio) # Can't use zip.extract(), because I want to ignore paths # within archive. src = zip.open('unkn

Copying a ZipExtFile

2009-10-23 Thread Moore, Mathew L
Hello all, A newbie here. I was wondering why the following fails on Python 2.6.2 (r262:71605) on win32. Am I doing something inappropriate? Interestingly, it works in 3.1, but would like to also get it working in 2.6. Thanks in advance, --Matt import io import shutil import tempfile import