problem zipping a text file with zlib

DeepBleu DeepBleu at DeepBleu.org
Thu Apr 11 13:18:43 EDT 2002


"Steve Holden" <sholden at holdenweb.com> wrote in message
news:93jt8.1445$F43.775 at atlpnn01.usenetserver.com...
> "DeepBleu" <DeepBleu at DeepBleu.org> wrote in message
> news:ubb56d6fvmpjf0 at corp.supernews.com...
> >
> [ ... ]
> > >
> > > Do you close the zipfile after you've finished writing it?
> > >
> > Do you mean text1.zip (from the code above) as the zipfile to be closed?
> > No, I am not!  I thought it was enough to close the ZipFile instance
> > (zip_archive).  Since text1.zip makes its appearance (first used) in:
> > >>>zip_archive = ZipFile("text1.zip", "w", 8)
> > How do I close the text1.zip (if that is the one you are refering to)?
> > DeepBleu
> >
> Ignore me. It was obvious in the code you gave that you are indeed
correctly
> closing the file after writing it.
>
> Since the zipfile format is binary, you should *not* be running Unix2DOS
to
> convert it -

Steve
I am not running Unix2DOS on the zipped text file (after zipping it).  I
would never really attempt to run Unix2DOS on a binary.  I am runnig
Unix2DOS on the text file itself.  Then, after that, I am zipping that text
file.
What I am doing is that I am taking a list of text files.  Run Unix2DOS on
each one of them, zip then, then FTP them to another Sun machine where
people can download them through a web broswer into their Windows PC's where
they can open them using WinZip usually.
Every text file is unzipping fine by the end users *except one*  Nothing  is
special about that one.  I looked at it.  There is just text.  This thing is
just freaky :-)
I applied the Python script on that text file only (unix2dos, zip, ftp) and
*it works*
I applied the Python script on it included with the other text files:  it
does not work and users report the 2-byte missing error!  The others:  They
work without a problem!
So for some reason, this text file in particular does not like running in a
batch process.  It is a text file with an attitude :)  What bugs me is that
I do not like such random things to arise.
Anyway, I know the above is not of much help in order to diagnose the
problem.  I'll just have to play with the script and the order by which the
files are being zipped to see if it makes any difference.
Thanks,
DeepBleu





More information about the Python-list mailing list