Message4122

Author billiejoex
Recipients amak, billiejoex
Date 2009-02-03.18:18:53
SpamBayes Score 2.10942e-15
Marked as misclassified No
Message-id <1233685139.34.0.872305941767.issue1238@psf.upfronthosting.co.za>
In-reply-to
Content
I'm the pyftpdlib author and even if it's not high priority I'd like to
see pyftpdlib work on Jython too.
pyftpdlib on Jython fails for many reasons.
By monkey patching such issues I managed to run the test suite despite a
lots of tests still keep failing.
Here's a list of some reasons why pyftpdlib test suite does not work on
Jython:


- Missing IPv6 support ( http://bugs.jython.org/issue1210 ) solved by
disabling the test

- asyncore.dispatcher._map attribute on Jython is deleted for no reason
( http://bugs.jython.org/issue1226 ) solved by monkey patching asyncore.py 

- socket.getservbyport not implemented (
http://bugs.jython.org/issue1225 ), solved by disabling the test

- missing buffer() function, solved by putting this piece of code
straight into ftpserver.py

try:
    buffer
except NameError:
    # hack for Jython which does not implement buffer() 
    def buffer(obj, start=None, stop=None):
        if not hasattr(obj, "__getitem__"):
            raise TypeError
        if start == None:
            start = 0
        if stop == None:
            stop = len(obj)
        return obj[start:stop]


Despite all these modifications I still get the following exception
(amongst others):
IOException: java.io.IOException: Unable to establish loopback connection

In case you want to try I attach the modified ftpserver.py and
test_ftpd.py scripts I modified to make them partially work with Jython,
and also the traceback message I get from the failing tests.

Note that I also get this error which is quite strange:


======================================================================
ERROR: test_retr_ascii (__main__.TestFtpRetrieveData)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_ftpd.py", line 1213, in test_retr_ascii
    expected = data.replace(os.linesep, '\r\n')
OutOfMemoryError: java.lang.OutOfMemoryError: Java heap space
History
Date User Action Args
2009-02-03 18:18:59billiejoexsetmessageid: <1233685139.34.0.872305941767.issue1238@psf.upfronthosting.co.za>
2009-02-03 18:18:59billiejoexsetrecipients: + billiejoex, amak
2009-02-03 18:18:59billiejoexlinkissue1238 messages
2009-02-03 18:18:58billiejoexcreate