two tracebacks with tkim:
When sending a message to an offline person on words:
Exception in Tkinter callback
Traceback (most recent call last):
File "c:\dev\python20\lib\lib-tk\Tkinter.py", line 1287, in __call__
return apply(self.func, args)
TypeError: not enough arguments; expected 2, got 1
and when connecting to an non-existing server:
Traceback (most recent call last):
File "c:\dev\twisted\twisted\spread\pb.py", line 999, in connectionFailed
File "c:\dev\twisted\twisted\words\ui\gateways\words.py", line 43, in connect
AttributeError: 'makeConnection' instance has no attribute 'connected'
besides that; there's a lil' problem with closing windows as I mentioned earlier. With my 3 seconds experience with tk I guess you add the wrong master to the "child"-windows.
Is it my imagination, or is twisted.reality somewhat similar to Python
Universe Builder? I have just discovered this after reading through the
i-f newsgroups this morning. I plan on downloading it and taking it home
to look at.
Does anyone else know anything about this?
Btw, how do I go about getting a TM home-page?
This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please
delete it and notify the sender. The contents of this e-mail are the
opinion of the writer only and are not endorsed by the Mincom Group
of companies unless expressly stated otherwise.
The first bug I ran into with twisted.ftp is that after 15 tcp.Ports has been opened and closed, skt.Listen starts to fail. This is due to the fact that when calling Port.loseConnection, the actual code called is Server.loseConnection which does not removeReader (actually, the Port.loseConnection is broken, since it calls removeReader and not main.removeReader). Well, there's seems to be two types of behaviour intended with the code, and of course, calling a loseConnection to the server shouldn't remove it entirely, but there should be a function doing that. Another thing, the limit for maximum Ports, where is it? And can shouldn't it be configurable?
And here follows the somewhat confusing traceback. Note that this is upon re-connecting the ftp-server. When the client can't connect to the server, there's nothing on the log.
01/09/2001 18:38 [FTP,1,127.0.0.1] Traceback (most recent call last):
01/09/2001 18:38 [FTP,1,127.0.0.1] File "c:\dev\twisted\twisted\internet\main.py", line 267, in doSelect
01/09/2001 18:38 [FTP,1,127.0.0.1] why = getattr(selectable, method)()
01/09/2001 18:38 [FTP,1,127.0.0.1] File "c:\dev\twisted\twisted\internet\tcp.py", line 82, in doRead
01/09/2001 18:38 [FTP,1,127.0.0.1] return self.protocol.dataReceived(data)
01/09/2001 18:38 [FTP,1,127.0.0.1] File "c:\dev\twisted\twisted\protocols\ftp.py", line 590, in dataReceived
01/09/2001 18:38 [FTP,1,127.0.0.1] self.processLine(line)
01/09/2001 18:38 [FTP,1,127.0.0.1] File "c:\dev\twisted\twisted\protocols\ftp.py", line 583, in processLine
01/09/2001 18:38 [FTP,1,127.0.0.1] n = method(params)
01/09/2001 18:38 [FTP,1,127.0.0.1] File "c:\dev\twisted\twisted\protocols\ftp.py", line 433, in ftp_Pasv
01/09/2001 18:38 [FTP,1,127.0.0.1] self.createPassiveServer()
01/09/2001 18:38 [FTP,1,127.0.0.1] File "c:\dev\twisted\twisted\protocols\ftp.py", line 379, in createPassiveServer
01/09/2001 18:38 [FTP,1,127.0.0.1] self.dtpPort.startListening()
01/09/2001 18:38 [FTP,1,127.0.0.1] File "c:\dev\twisted\twisted\internet\tcp.py", line 297, in startListening
01/09/2001 18:38 [FTP,1,127.0.0.1] skt.listen(self.backlog)
01/09/2001 18:38 [FTP,1,127.0.0.1] File "<string>", line 1, in listen
01/09/2001 18:38 [FTP,1,127.0.0.1] error: (10055, 'No buffer space available')
> Take a look at Medusa (www.nightmare.com/medusa) VFS as an example of
> how *not* to do it. One thing I learned from it - string paths are EVIL,
> especially in FTP where paths such as /baz/.././//foo/../bar are legal.
> Paths should therefore be represented by lists, e.g. ['baz', 'foo', 'bar'].
Yes, I figured :) I made the same mistake when writing my first vfs draft  some time ago. At least it got mount.
> The next problem is that it's usually hard to know if the last item is a
> file or a folder (if the path is '/foo/bar', is 'bar' a file or a
> folder?). In systems like Zope it's even harder since an object can
> function as both.
Useful for a zip-fs :) My gut-reaction would say that '/foo/bar' is a file, '/foo/bar/' is a directory. In ftp this is a matter of having a client which can handle it (but it will without doubt create problems on _many_ clients), most of the trouble is solved through context 'RETR <file>' vs 'CD <dir>'; but it wont solve 'SITE CHMOD <path>' (not implemented :P ). Such cases will create problems, but this is due to badly specified protocols. PB won't have this problem ;)
> I would suggest you get a WebDAV implementation going before you (or any
> other interested party) start working on a VFS layer. WebDAV is more
> generic (it support "collections", not "folders"), supports arbitary
> properties on objects (metadata), etc.. And supporting two different
> systems will amke sure you don't make any protocol specific design
> decisions (such as Medusa's VFS, where it passes the VFS the path string
> specified by the user, so the VFS must deal with '..', './../foo//bar'
> and all that crap.)
Two different systems? You mean WebDAV and a FTP? Yes, it sounds interesting, though I have to read a bit more on it to understand WebDAV's concept. It seems to fill most of the requirements. The VFS will maybe be just a storage-specific layer, while WebDAV is built on top of it. I need to read on it before I try to fill in anything more. :)
Well, I ought to add some words were I think twisted.ftp is heading too. The first things to do, is to add proper authentication, and filling in some holes (eg, resume and hash). A better path-handling, since os.path is silly under windows, and os.path.isabs('\..'). Distributed is the next big spot. I'm not entirely safe with it yet, but I think it should be easy to nail. One pending 'TODO' is to make it deployable as a systemwide ftp (without requiring each and every user to setup their own ftp-server).
So, if I jump forward in time, and extend the view to storing eg. media-files generally, I think the need of a vfs of some kind arises. What follows is some random notes on it, with varying value, and passing the scope of twisted.ftp with lightyears.
There's two properties it requires: it has to store metadata , and it has to support different 'filesystems'.
The direct effect of the storing the metadata is that the differences between OSes and platforms can be compensated and metadata don't have to be lost due to the filesystems. Though, I think this can be a burden too (should it keep all the metadata in dicts and stored in fragile taps?).
There's only one filesystem I know which can easily store metadata, and that is a database :) twisted.enterprise could turn handy here, though it seems to require an external SQL-server. Correct me if I'm wrong.
Other filesystems? The OS's filesystem, FTP, Source-Code (hm),
Some other requirements, is the ability to refer to a file independent of its physical location, pass the reference over PB, do basic operations, and of course, version-checking etc.
This issue is probably related to the "File Transfer"-layer which is mentioned in the TODO too:
File Transfer layer for PB. This would be especially nice for
twisted.words; having standard a way to transfer "large" (100MB+) packets
across or in tandem with a PB connection without breaking anything would be
I just commited twisted.ftp, and I think it is pretty neat. Not everything is supported, but it should work with any ftp-client out there. To get it up and running, just 'mktap -r ~/myftp', where '~/myftp' is the directory you want to leech; the default is '/pub/usr/local'. Start the server with twistd, and ftp to your server on port 2121. Login as 'twisted' with the password 'twisted'. The password is stored plaintext, so be careful ;) Now have fun with upload and download.
What I haven't told you: I haven't tested it under linux, so I'm curious if it works at all. Also, test it on the most bizarre ftp-clients you have (MSIE works), and tell me how it fared.