mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Deprecate quickstart.term_decode() and remove internal uses
Per the Python 3 docs, input() always returns a string:
https://docs.python.org/3/library/functions.html#input
> The function then reads a line from input, converts it to a
> string (stripping a trailing newline), and returns that.
The stubs from typeshed say the same:
5c69373890/stdlib/3/builtins.pyi (L835)
Here is the implementation from CPython with also shows a call to
PyUnicode_Decode on the result:
https://github.com/python/cpython/blob/3.7/Python/bltinmodule.c#L1960-L2143
As the value is always a string, there is nothing to decode. Therefore
the call to term_decode() unnecessary and can safely be removed.
With this in mind, must adjust quickstart tests to be more
representative.
This commit is contained in:
@@ -152,6 +152,16 @@ The following is a list of deprecated interfaces.
|
||||
- 4.0
|
||||
- ``docutils.nodes.abbreviation``
|
||||
|
||||
* - ``sphinx.cmd.quickstart.term_decode()``
|
||||
- 2.0
|
||||
- 4.0
|
||||
- N/A
|
||||
|
||||
* - ``sphinx.cmd.quickstart.TERM_ENCODING``
|
||||
- 2.0
|
||||
- 4.0
|
||||
- ``sys.stdin.encoding``
|
||||
|
||||
* - ``sphinx.config.check_unicode()``
|
||||
- 2.0
|
||||
- 4.0
|
||||
|
||||
Reference in New Issue
Block a user