def passivemode_msg(protocol, host='127.0.0.1', port=12345):
 msg = ('227 Entering Passive Mode (%s).' % (ftp.encodeHostPort(host, port),))
 return msg.encode(protocol._encoding)

def passivemode_msg ( protocol , host = '127.0.0.1' , port = 12345 ) : msg = ( '227 Entering Passive Mode (%s).' % ( ftp . encodeHostPort ( host , port ) , ) ) return msg . encode ( protocol . _encoding )
construct a passive mode message with the correct encoding .