This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: python shell crashed while input quotes in print()
Type: crash Stage: resolved
Components: IDLE, macOS, Tkinter Versions: Python 3.6
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: ned.deily, py78py90py, ronaldoussoren, serhiy.storchaka, steven.daprano, terry.reedy
Priority: normal Keywords:

Created on 2017-08-08 12:09 by py78py90py, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
crashlog.txt py78py90py, 2017-08-09 14:05 IDLE crash log
Messages (6)
msg299909 - (view) Author: (py78py90py) Date: 2017-08-08 12:09
I have downloaded python 3.6 into MacOSX system.
Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin

Then I opened the IDLE and try to input some sentences.
I inputed "print()", then input single quote in print.
But the IDLE crashed.
msg299956 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2017-08-09 00:27
I'm afraid your error report isn't completely clear. What do you mean "input single quote in print"? Do you mean this?

    print(')


You say IDLE "crashed". What do you mean? Do you mean the IDLE application put up an error message and then disappeared? If so, what was the error message?

If IDLE said something like:

    SyntaxError: EOL while scanning string literal

that's perfectly normal. That's because you haven't written a valid string, you need to quote the single quote: print("'").
msg300010 - (view) Author: (py78py90py) Date: 2017-08-09 14:05
Sorry for the incomplete information.

I have inputed following line:
print(")
IDLE crashed.
I also input following line:
print(')
IDLE also crashed.
I have uploaded the crash log.
msg300030 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-08-09 19:21
There is still something you left out.  Entering either print(")<return> or print(')<return> at either a shell prompt or in a file and running the file should result in "SyntaxError: EOL while scanning string literal", as Steven said.  Ditto for eval("print(')") or eval('print(")').  The error comes from Python's compile() function.  The result *should* be the same on all systems. This is feature, neither a crash nor a bug.  So my first inclination was to close this as 'Not a bug'.

But getting a system crash log is usually a bug when running Python code. From my reading of Mac's crash log, what crashed is not IDLE but Python running _tkinter calling tcl running tk calling OSX's CoreFoundation which raised NSRangeException.  How did you bypass compile()?

Where did you get the Python that you installed?  If from python.org, did you pay attention to https://www.python.org/download/mac/tcltk/ and install a tcl/tk that works?  If not, not our bug.

Ned and Serhiy: can we patch  _tkinter on Mac to refuse to run with the buggy Apple tcl/tk?  Or at least pop up a Warning box that says to not bug us when it crashes?
msg300069 - (view) Author: (py78py90py) Date: 2017-08-10 10:33
I downloaded python from www.python.org. And I think I have tcl/tk installed.

Python 3.6.2 (v3.6.2:5fd33b5926, Jul 16 2017, 20:11:06) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "copyright", "credits" or "license()" for more information.
>>> WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable.
Visit http://www.python.org/download/mac/tcltk/ for current information.

I am trying to use the recommended tcltk version.
msg300186 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2017-08-12 03:23
Note that the web page states you need to use Tcl/Tk 8.5.18, and not 8.6.x.  Both are available from ActiveState here:

https://www.activestate.com/activetcl/downloads

Try installing 8.5.18 (you don't need to uninstall 8.6.x) and your crashes should go away.
History
Date User Action Args
2022-04-11 14:58:49adminsetgithub: 75325
2017-08-12 03:23:59ned.deilysetstatus: open -> closed
resolution: third party
messages: + msg300186

stage: resolved
2017-08-10 10:33:01py78py90pysetmessages: + msg300069
2017-08-10 04:52:50terry.reedysetassignee: terry.reedy ->
2017-08-09 19:21:41terry.reedysetnosy: + ned.deily, serhiy.storchaka, ronaldoussoren
messages: + msg300030

components: + macOS, Tkinter
type: crash
2017-08-09 14:05:31py78py90pysetfiles: + crashlog.txt

messages: + msg300010
2017-08-09 00:27:16steven.dapranosetnosy: + steven.daprano, terry.reedy
messages: + msg299956

assignee: terry.reedy
components: + IDLE, - Demos and Tools
2017-08-08 12:09:52py78py90pycreate