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):