Author billiejoex
Recipients amak, billiejoex
Date 2009-02-03.18:18:53
SpamBayes Score 2.10942e-15
Marked as misclassified No
Message-id <>
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

- Missing IPv6 support ( ) solved by
disabling the test

- asyncore.dispatcher._map attribute on Jython is deleted for no reason
( ) solved by monkey patching 

- socket.getservbyport not implemented ( ), solved by disabling the test

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

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: Unable to establish loopback connection

In case you want to try I attach the modified and 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 "", line 1213, in test_retr_ascii
    expected = data.replace(os.linesep, '\r\n')
OutOfMemoryError: java.lang.OutOfMemoryError: Java heap space
Date User Action Args
2009-02-03 18:18:59billiejoexsetmessageid: <>
2009-02-03 18:18:59billiejoexsetrecipients: + billiejoex, amak
2009-02-03 18:18:59billiejoexlinkissue1238 messages
2009-02-03 18:18:58billiejoexcreate