Grant Jenks <[email protected]> added the comment:
This issue was closed but I still see the problem in 3.7.2. Here's a snippet
with line numbers from IDLE:
01 Python 3.7.2 (default, Dec 30 2018, 08:59:00)
02 [Clang 9.1.0 (clang-902.0.39.2)] on darwin
03 Type "help", "copyright", "credits" or "license()" for more information.
04 >>> 1 + 2
05 3
06 >>> print('Hello')
07 Hello
08 >>> d = {1: 'uno', 2: 'dos', 3: 'tres}
09
10 SyntaxError: EOL while scanning string literal
11 >>> 1 + 2
12
13 3
14 >>>
Notice that IDLE is inserting an extra blank line at (12) above.
And here's a snippet with line numbers from the Python shell:
01 Python 3.7.2 (default, Dec 30 2018, 08:59:00)
02 [Clang 9.1.0 (clang-902.0.39.2)] on darwin
03 Type "help", "copyright", "credits" or "license" for more information.
04 >>> 1 + 2
05 3
06 >>> print('Hello')
07 Hello
08 >>> d = {1: 'uno', 2: 'dos', 3: 'tres}
09 File "<stdin>", line 1
10 d = {1: 'uno', 2: 'dos', 3: 'tres}
11 ^
12 SyntaxError: EOL while scanning string literal
13 >>> 1 + 2
14 3
15 >>>
Between lines (13) and (14) there is no extra blank line.
I'm sorry if my initial post was unclear. But the extra blank line is the bug
I'm describing. I don't think there should be an extra blank line between (11)
and (13) in the IDLE shell. This blank line persists for every input, even
after restarts.
I'm on macOS.
I would be interested in debugging the issue locally but I ran into a couple
issues trying to do so. When I check out the CPython sources and build the
python.exe executable, I get this error when trying to execute IDLE:
$ ./python.exe -m pdb -m idlelib.idle
> /Users/grantj/repos/cpython/Lib/idlelib/idle.py(1)<module>()
-> import os.path
(Pdb) c
Traceback (most recent call last):
File "/Users/grantj/repos/cpython/Lib/pdb.py", line 1695, in main
pdb._runmodule(mainpyfile)
File "/Users/grantj/repos/cpython/Lib/pdb.py", line 1540, in _runmodule
self.run(code)
File "/Users/grantj/repos/cpython/Lib/bdb.py", line 585, in run
exec(cmd, globals, locals)
File "/Users/grantj/repos/cpython/Lib/idlelib/idle.py", line 1, in <module>
import os.path
File "/Users/grantj/repos/cpython/Lib/idlelib/pyshell.py", line 1507, in main
macosx.setupApp(root, flist)
File "/Users/grantj/repos/cpython/Lib/idlelib/macosx.py", line 280, in
setupApp
overrideRootMenu(root, flist)
File "/Users/grantj/repos/cpython/Lib/idlelib/macosx.py", line 181, in
overrideRootMenu
del mainmenu.menudefs[-2][1][0]
IndexError: list assignment index out of range
If I comment out line 181 in /Users/grantj/repos/cpython/Lib/idlelib/macosx.py
then I can get IDLE to start. But it will later crash trying to display the
first tooltip:
$ ./python.exe -m pdb -m idlelib.idle
> /Users/grantj/repos/cpython/Lib/idlelib/idle.py(1)<module>()
-> import os.path
(Pdb) c
2019-01-02 15:52:57.582 python.exe[23803:6374992] *** Assertion failure in
-[_NSCGSWindow setFrame:],
/BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1561.60.100/CGS.subproj/NSCGSWindow.m:1002
2019-01-02 15:52:57.588 python.exe[23803:6374992] *** Terminating app due to
uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid
parameter not satisfying: CGRectContainsRect(CGRectMake((CGFloat)INT_MIN,
(CGFloat)INT_MIN, (CGFloat)INT_MAX - (CGFloat)INT_MIN, (CGFloat)INT_MAX -
(CGFloat)INT_MIN), frame)'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff48fa923b
__exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff7023ac76
objc_exception_throw + 48
2 CoreFoundation 0x00007fff48faefd2
+[NSException raise:format:arguments:] + 98
3 Foundation 0x00007fff4b0d9150
-[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
+ 193
4 AppKit 0x00007fff465d6f50
-[_NSCGSWindow setFrame:] + 475
5 AppKit 0x00007fff4668eb07
_NSCreateWindowWithOpaqueShape2 + 248
6 AppKit 0x00007fff4668d763 -[NSWindow
_commonAwake] + 1057
7 AppKit 0x00007fff46d9bbe7
-[NSWindow(NSWindow_Carbon)
windowRefWithCompositedAttribute:andFrameworkScaledAttribute:] + 139
8 Tk 0x00000001061f9ad5 XMapWindow +
239
9 Tk 0x0000000106166dbf Tk_MapWindow
+ 89
10 Tk 0x000000010616fcc5 MapFrame + 62
11 Tcl 0x00000001060c05cd
TclServiceIdle + 76
12 Tcl 0x00000001060a4a96
Tcl_DoOneEvent + 329
13 Tk 0x0000000106145f7d
Tk_UpdateObjCmd + 172
14 Tcl 0x000000010603ed6f
TclEvalObjvInternal + 773
15 Tcl 0x000000010603ff42 Tcl_EvalObjv
+ 66
16 _tkinter.cpython-37dm-darwin.so 0x000000010601a865 Tkapp_Call +
901
17 python.exe 0x0000000104e27d14
_PyMethodDef_RawFastCallKeywords + 1476
18 python.exe 0x0000000104e34394
_PyMethodDescr_FastCallKeywords + 388
19 python.exe 0x0000000104ff89cf
call_function + 1535
20 python.exe 0x0000000104ff0f15
_PyEval_EvalFrameDefault + 82021
21 python.exe 0x0000000104fdcea7
PyEval_EvalFrameEx + 87
22 python.exe 0x0000000104e26a29
function_code_fastcall + 377
23 python.exe 0x0000000104e25dbc
_PyFunction_FastCallKeywords + 668
24 python.exe 0x0000000104ff8b5a
call_function + 1930
25 python.exe 0x0000000104ff0f15
_PyEval_EvalFrameDefault + 82021
26 python.exe 0x0000000104fdcea7
PyEval_EvalFrameEx + 87
This was the case for both the master (e9a044ec16) and the 3.7 (d7cb2034bb)
branch. Is there something extra I need to configure for a working build on
macOSX?
----------
resolution: fixed ->
status: closed -> open
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34055>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com