Giampaolo Rodola' <g.rod...@gmail.com> added the comment:

Considering the security implications and the fact that it's a corner case I 
don't think this is worth adding as a new, public API, sorry. I think ftplib 
should expose and promote APIs reflecting common scenarios and good practices, 
yet be flexible enough in order to allow "breaking the rules". FWIW, you may 
get away with something like this, which IMO is not too bad (not tested): 


class FTP(ftplib.FTP):
    externalip = None

    def sendport(self, host, port):
        return super().sendport(self.externalip or host, port)

    def sendeprt(self, host, port):
        return super().sendeprt(self.externalip or host, port)

----------
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32572>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to