[Python-Dev] Re: pre-PEP: Unicode Security Considerations for Python

2021年11月01日 10:39:18 -0700

This is excellent!
01.11.21 14:17, Petr Viktorin пише:
>> CPython treats the control character NUL (``0円``) as end of input,
>> but many editors simply skip it, possibly showing code that Python
>> will not
>> run as a regular part of a file.
It is an implementation detail and we will get rid of it. It only
happens when you read the Python script from a file. If you import it as
a module or run with runpy, the NUL character is an error.
>> Some characters can be used to hide/overwrite other characters when
>> source is
>> listed in common terminals:
>>
>> * BS (``\b``, Backspace) moves the cursor back, so the character after it
>>  will overwrite the character before.
>> * CR (``\r``, carriage return) moves the cursor to the start of line,
>>  subsequent characters overwrite the start of the line.
>> * DEL (``\x7F``) commonly initiates escape codes which allow arbitrary
>>  control of the terminal.
ESC (``\x1B``) starts many control sequences.
``1円A`` means the end of the text file on Windows. Some programs (for
example "type") ignore the rest of the file.
_______________________________________________
Python-Dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/[email protected]/message/CBI7ME3YUAVVH5B6LSC745GJSVUIZJHO/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to