Opened 11 years ago

Closed 8 years ago

#2738 defect closed duplicate (duplicate) containing host name instead of ip address

Reported by: toidinamai Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:


The following program

from twisted.internet.protocol import Protocol, ClientFactory

class TestProtocol(Protocol):
    def connectionMade(self):
        peer = self.transport.getPeer()
        print "I'm connected to %s on port number %s." % (, peer.port)

class TestFactory(ClientFactory):
    protocol = TestProtocol

if __name__ == "__main__":
    import sys
    from twisted.internet import reactor
    reactor.connectTCP(sys.argv[1], sys.argv[2], TestFactory())

when run as python localhost ssh should print

I'm connected to on port number 22.

but instead prints

I'm connected to localhost on port number 22.

This seems to be a bug as the documentation for t.i.a.IPv4Address states that the host attribute should be "a string containing the dotted-quad IP address".

Change History (2)

comment:1 Changed 8 years ago by Jean-Paul Calderone

Resolution: duplicate
Status: newclosed

#3059 was a duplicate of this, and fortunately has been resolved.

comment:2 Changed 7 years ago by <automation>

Owner: Glyph deleted
Note: See TracTickets for help on using tickets.