From d04966dcec2f8e34f0ec0aea216ea098673ae90b Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Thu, 12 Jan 2023 21:17:00 -0500 Subject: Swap around __bytes__/__str__ for some classes Plus related updates to tests, docstrings, changelog --- sites/www/changelog.rst | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sites') diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 595e2fde..63cb6d60 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,14 @@ Changelog ========= +- :bug:`- major` A handful of lower-level classes (notably + `paramiko.message.Message` and `paramiko.pkey.PKey`) previously returned + `bytes` objects from their implementation of ``__str__``, even under Python + 3; and there was never any ``__bytes__`` method. + + These issues have been fixed by renaming ``__str__`` to ``__bytes__`` and + relying on Python's default "stringification returns the output of + ``__repr__``" behavior re: any real attempts to ``str()`` such objects. - :support:`-` ``paramiko.common.asbytes`` has been moved to `paramiko.util.asbytes`. -- cgit v1.2.1