[Zope] ZIPFolder Fix Ignore Files w/ spaces

eric.n.dunn@bankofamerica.com eric.n.dunn@bankofamerica.com
Fri, 31 May 2002 09:05:23 -0400


This was it!  Thankyou very much!

Couldn't find the code in "ZipFile.py" since "ZipFolder 0.2.2" doesn't have
that specific file by default.

-rw-r--r--    1 zwww     zwww         6550 May 31 05:41 ZipFolder.py
-rw-r--r--    1 zwww     zwww        24360 Apr  6  2001 zipfile152.py

Looked for it in "ZipFolder.py" and found it.
Code change to "ZipFolder.py":

# check zip file names for:
# filenamepattern=re.compile(r'[A-Za-z0-9][\w\_\-\.]*$')  <--- OLD
filenamepattern=re.compile(r'[A-Za-z0-9 ][\w\_\-\. ]*$')   <--- NEW

Tested and worked perfect the first time.  Files w/ spaces not ignored
anymore and rendered just fine in presentation layer.

You the man!!!
Thanks again
Eric









Jens Quade <jq@jquade.de> on 05/30/2002 03:25:14 PM

To:   Eric N. Dunn/USA/BAC@BankofAmerica
cc:
Subject:  Re: ZIPFolder




Am Donnerstag den, 30. Mai 2002, um 20:07, schrieb
eric.n.dunn@bankofamerica.com:

> Saw a fix issue for "files ignored" problem at:
> http://zope.nipltd.com/public/lists/zope-
>
archive.nsf/47ba74c812dbc5dd8025687f0024bb5f/f7ed1f6f1f10ed8380256a2600534415?

> OpenDocument&Highlight=0,zipfolder

That was a fix for zip file compatiblity, Python < 2.1 contained
an broken zipfile module.


> I'm using "ZipFolder 0.2.2" and I still get the "ignored file" problem.

Zipfile refuses to import files with strange filenames. The pattern
is a bit strict...


If you want to import files with spaces, find the following lines
in ZipFile.py:

# check zip file names for:
filenamepattern=re.compile(r'[A-Za-z0-9][\w\_\-\.]*$')

and change it to:

# check zip file names for:
filenamepattern=re.compile(r'[A-Za-z0-9 ][\w\_\-\. ]*$')

(note the added blanks)

jens