Autodetect response type in ControlMessage.from_str()
|Reported by:||atagar||Owned by:||atagar|
Presently the from_str() method provides back a ControlMessage instance, which the caller then needs to call convert() on to translate it to the appropriate subclass. This is pretty clunky and, when responses have prefix headers (like '650 BUILDTIMEOUT_SET') we should be able to detect the type on their behalf.
We should check if convert() is idempotent (ie, calling it twice on a control message is safe). If so then we can change the default from_str() behavior, but if not we'll need to do something different to preserve backward compatibility.
Change History (7)
comment:4 Changed 4 years ago by meejah
- Resolution wontfix deleted
- Status changed from closed to reopened