[Zope] zclasses, method names with trailing '%20', ftp

Chris Price cprice@orbik.com
27 Nov 2001 11:58:22 -0600


Hi,

I'm attempting to develop a product using ZClasses, and have hit a
slight snag.

As most of you probably know, Zope appends a trailing space ('%20') to
the names/ids of methods inside of a ZClass.  I have read that this is
done to prevent naming conflicts, and that it only occurs inside of the
Products folder.  So when you instantiate a ZClass somewhere in your
zope tree, the '%20's are not required in URL's and such.

My problem (more of an annoyance, really) is that I have been using
Emacs to edit my zope python scripts and some of my dtml methods, via
FTP.  It had been working great until I tried to FTP into a nested
ZClass, but now the '%20's are messing up my ftp access.  This is not an
emacs problem, I have tried to ftp from the command line and still I
cannot get to the objects.

Here is a simple example of how to reproduce this problem:

1) Create a new product called 'foo'.
2) Inside the product, add a ZClass, also called 'foo'.
3) Inside of that ZClass, create another ZClass called 'bar'.
4) Inside of 'bar' (in the propertysheets/methods), add a DTML doc or
any other type of object, call it 'bunk'.
5) Try to ftp into your zserver and navigate to 'bunk'.  I cannot figure
out a way to do it.

Here is one of my ftp sessions.  It is interesting to note that the ftp
server accepts either 'cd bar' or 'cd "bar "', and seems to think that
either is a legitimate 'directory'.  but then when I try to go into the
'methods' dir, it just won't work.  And this only seems to happen on
nested zclasses--if I try to do 'cd "foo "' I get a "no such directory"
error, as I would expect/hope.  I would really prefer to edit my objects
with emacs, does anyone know of any other way to do this?

Thanks in advance for any advice/opinions!

Chris Price
cprice@orbik.com

ftp transcript:
******************************************************************************
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd Control_Panel/Products/foo
250 CWD command successful.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list
d---------   1 Zope     Zope            0 Nov 27 17:44 ..
drwxrwx---   1 cprice   Zope            0 Nov 27 17:44 Help
----------   1 cprice   Zope            0 Nov 27 17:45
bar_add_permission
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 foo
-rw-rw----   1 cprice   Zope         1463 Nov 27 17:45 foo_add
-rw-rw----   1 cprice   Zope          311 Nov 27 17:45 foo_addForm
----------   1 cprice   Zope            0 Nov 27 17:45
foo_add_permission
----------   1 cprice   Zope            0 Nov 27 17:45 foo_factory
226 Transfer complete
ftp> cd foo
250 CWD command successful.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list
d---------   1 cprice   Zope            0 Nov 27 17:45 ..
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 propertysheets
226 Transfer complete
ftp> cd propertysheets/methods
250 CWD command successful.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 ..
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 bar
-rw-rw----   1 cprice   Zope         1463 Nov 27 17:45 bar_add
-rw-rw----   1 cprice   Zope          311 Nov 27 17:45 bar_addForm
----------   1 cprice   Zope            0 Nov 27 17:45 bar_factory
226 Transfer complete
ftp> cd bar
250 CWD command successful.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 ..
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 propertysheets
226 Transfer complete
ftp> cd propertysheets
250 CWD command successful.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 ..
drwxrwx---   1 Zope     Zope            0 Nov 27 17:46 methods
226 Transfer complete
ftp> cd methods
550 No such directory.
ftp> ls methods
200 PORT command successful.
550 Could not list directory.
ftp> cd ../..
250 CWD command successful.
ftp> pwd
257 "/Control_Panel/Products/foo/foo/propertysheets/methods" is the
current directory.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 ..
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 bar
-rw-rw----   1 cprice   Zope         1463 Nov 27 17:45 bar_add
-rw-rw----   1 cprice   Zope          311 Nov 27 17:45 bar_addForm
----------   1 cprice   Zope            0 Nov 27 17:45 bar_factory
226 Transfer complete
ftp> cd "bar "
250 CWD command successful.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 ..
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 propertysheets
226 Transfer complete
ftp> cd propertysheets/methods
550 No such directory.
ftp> cd propertysheets
250 CWD command successful.
ftp> cd methods
550 No such directory.
ftp> ls methods
200 PORT command successful.
550 Could not list directory.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list
drwxrwx---   1 Zope     Zope            0 Nov 27 17:45 ..
drwxrwx---   1 Zope     Zope            0 Nov 27 17:46 methods
226 Transfer complete