Opened 3 years ago

#9713 enhancement new

IKnownHostEntry and PlainHost/HashedHost string type confusion

Reported by: Tom Most Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author:

Description

twisted.conch.interfaces.IKnownHostEntry.matchesHost()'s hostname argument is documented as type str, but the implementations disagree:

twisted.conch.client.knownhosts.PlainHost and twisted.conch.client.knownhosts.HashedHost both document the parameter as type bytes. The implementations accept both str and bytes (str is encoded to utf-8j).

What string type does the actual client implementation pass? That is, if someone implements IKnownHostEntry according to the interface, will it work with the Conch client? The interface should document the type that promotes this type of compatibility. (If the interface is wrong and the type should be bytes, that's not a backwards-incompatible change, it's just a bug in the docs that probably occurred when porting to Python 3.)

Change History (0)

Note: See TracTickets for help on using tickets.