[issue35467] IDLE: unrequested pasting into Shell after restart

Terry J. Reedy report at bugs.python.org
Sun Jan 16 23:10:46 EST 2022


Terry J. Reedy <tjreedy at udel.edu> added the comment:

I finally caught an example, which was not immediately after restart.  I copied the two lines of output, entered 'import re\n' and the copied text was pasted, then the line with the addition compiled, leading to the error.

Type "help", "copyright", "credits" or "license()" for more information.
>>> for c in '℘·': hex(ord(c))
... 
'0x2118'
'0xb7'
>>> import re'0x2118'
... '0xb7'
SyntaxError: invalid syntax
>>> for c in '℘·': hex(ord(c))

I pasted the copied output into an issue on the browser and did other stuff before coming back to this window to try something with re.

Differences from my initial report: No RESTART (though usually or often is), no exception, not first entry (but first time not?).  

Edit menu item 'Paste' and the shortcut are bound to IDLE-defined pseudoevent '<<paste>>' which invokes method EditorWindow.paste which calls event_generate('<<Paste>>'), where the latter event is a tk-defined event. Where triggered?  I could add a print-to-console in .paste?  Happening only in shell and after Enter suggest looking as shell-specific part of Enter handling.  If never on Linux, could x-11-only fix-x11-paste (called in pyshell.main) explain why not?

I searched stackoverflow [tkinter] questions for 'paste'.  Got 840 responses, looked as first page, saw nothing relevant.  Adding 'unwanted', 'unexpected', or 'spontaneous' resulted in no hits.  I will consider asking a question myself.

----------
nosy: +epaine

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35467>
_______________________________________


More information about the Python-bugs-list mailing list