From 31161e7a086daf60fca2ea65baf973d56dfaaeb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 14 Apr 2020 13:15:40 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20docs:=20minor=20fixes=20in=20oct?= =?UTF-8?q?oprint.util?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/octoprint/util/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/octoprint/util/__init__.py b/src/octoprint/util/__init__.py index bdb5ab164..00bd0a03d 100644 --- a/src/octoprint/util/__init__.py +++ b/src/octoprint/util/__init__.py @@ -89,7 +89,10 @@ def to_unicode(s_or_u, encoding="utf-8", errors="strict"): def to_native_str(s_or_u): # type: (Union[unicode, bytes]) -> str - """Make sure ``s_or_u`` is a 'str'.""" + """ + Make sure ``s_or_u`` is a native 'str' for the current Python version + + Will ensure a byte string under Python 2 and a unicode string under Python 3.""" if sys.version_info[0] == 2: return to_bytes(s_or_u) else: @@ -280,7 +283,9 @@ Returns: """ -to_str = deprecated("to_str has been renamed to to_bytes", since="1.3.11")(to_bytes) +to_str = deprecated("to_str has been renamed to to_bytes", + includedoc="to_str has been renamed to to_bytes", + since="1.3.11")(to_bytes) def get_formatted_size(num):