[issue30431] input function truncates prompt by NULL byte

Serhiy Storchaka report at bugs.python.org
Sun May 28 03:56:05 EDT 2017


Serhiy Storchaka added the comment:

If stdin and stdout are attached to a terminal, input() uses the readline library (if it is available) for displaying the prompt and reading user input. This is the limitation of the readline library and Python C API that this works with null-terminated C strings. You also can't enter the null character.

UnicodeEncodingError is raised if the prompt contains characters not encodable with the stdout encoding. Consider ValueError raised if the prompt contains the null character as similar restriction.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30431>
_______________________________________


More information about the Python-bugs-list mailing list