-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
Description
Bug report
Bug description:
GNU/Linux 5.4.19 x86_64 GNU/Linux
python 3.14.0a4
echo $TERM
xterm-256color
stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^; erase = ^?; kill = ^U; eof = ^D; eol = ;
eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc
If you copy any text to the clipboard, for example, a URL from a browser, and paste it into the terminal, the paste occurs with a control sequence, which is not cut off later.
$ python program.py
url = input("Enter url: ")
print("\nurl =", url)
print(repr(f"repr/url = {url}"))
If you pass the variable "url" further for processing, for example to the library "requests" an error will occur, since the variable "url" contains control sequence characters (detected via "repr").
And secondly: "\n" does not work, see code and screenshot.
Why, when you paste text from the clipboard into the terminal, does the control sequence get pasted too? And why isn't it cut off (if it's so important to you)?
Do you realize how many programs you're breaking with such an ill-considered innovation?
CPython versions tested on:
3.14
Operating systems tested on:
Linux