⏪ Don't rename to_unicode to to_str after all

... at least not yet. to_str is currently a (deprecated)
synonym for to_bytes, and changing that behaviour
would be a breaking change. Better leave it to 2.0.
This commit is contained in:
Gina Häußge committed 2022-02-07 15:31:16 +01:00
1 parent c904277430
commit 535dcb7109
19 files changed
+132 -105

No files matched your search

+1 -1
View File
@@ -211,7 +211,7 @@ NOT need to convert to bytes when implementing API endpoints that return JSON, a
anyhow.
OctoPrint includes two utility methods you should use to ensure your strings enter/exit your code in the right format,
under both Python versions: :py:func:`octoprint.util.to_bytes` and :py:func:`octoprint.util.to_str`. Use them to ensure the correct data
under both Python versions: :py:func:`octoprint.util.to_bytes` and :py:func:`octoprint.util.to_unicode`. Use them to ensure the correct data
types and to avoid weird conversion and encoding issues during runtime.
You can read more about this specific issue in the corresponding section of the