robertlugg / easygui

easygui for Python
http://easygui.readthedocs.org/en/master/
BSD 3-Clause "New" or "Revised" License
455 stars 114 forks source link

Reproducible Crashes with ˆ and ˜ Characters on Mac OS X and Python 3 #139

Closed ghost closed 6 years ago

ghost commented 6 years ago

After the last issue I submitted ended up being related to the Python install method, I tried my best to give the most accurate description of the problem, so, here you go:

Every time I try to type ˆ or ˜ (weirdly enough, Ç works fine though), the entire Python 3 crashes.

I'm attaching to this issue report a video where it happens several times, and also the terminal output post error.

Environment: Mac OS Sierra 10.12.6 Python vers. Python 3.6.0 build 5666 Script Source Code: gist.github.com/gustavohmsilva/9dd8b25c94e9bf6b70ccccb7d1d69685 Video with the crash in real time: https://vimeo.com/251317957 Post crash report on terminal:

$gCSVtool 
2018-01-16 11:56:23.585 Python[16408:4013955] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFConstantString characterAtIndex:]: Range or index out of bounds'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fffa906357b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x00007fffbe2c51da objc_exception_throw + 48
    2   CoreFoundation                      0x00007fffa90e0c55 +[NSException raise:format:] + 197
    3   CoreFoundation                      0x00007fffa8fdc396 -[__NSCFString characterAtIndex:] + 102
    4   Tk                                  0x00000001059a1c73 TkpInitKeymapInfo + 753
    5   Tk                                  0x00000001059a7d6b Tk_MacOSXSetupTkNotifier + 909
    6   Tcl                                 0x000000010587cc38 Tcl_DoOneEvent + 317
    7   _tkinter.cpython-36m-darwin.so      0x00000001003e9aa1 _tkinter_tkapp_mainloop + 209
    8   Python                              0x0000000100069558 _PyCFunction_FastCallDict + 568
    9   Python                              0x00000001000f1fd4 call_function + 612
    10  Python                              0x00000001000f7e28 _PyEval_EvalFrameDefault + 23096
    11  Python                              0x00000001000f1390 _PyEval_EvalCodeWithName + 2720
    12  Python                              0x00000001000f1b9b fast_function + 219
    13  Python                              0x00000001000f1fbb call_function + 587
    14  Python                              0x00000001000f7e28 _PyEval_EvalFrameDefault + 23096
    15  Python                              0x00000001000f1d1e fast_function + 606
    16  Python                              0x00000001000f1fbb call_function + 587
    17  Python                              0x00000001000f7e28 _PyEval_EvalFrameDefault + 23096
    18  Python                              0x00000001000f1d1e fast_function + 606
    19  Python                              0x00000001000f1fbb call_function + 587
    20  Python                              0x00000001000f7e28 _PyEval_EvalFrameDefault + 23096
    21  Python                              0x00000001000f1390 _PyEval_EvalCodeWithName + 2720
    22  Python                              0x00000001000f1b9b fast_function + 219
    23  Python                              0x00000001000f1fbb call_function + 587
    24  Python                              0x00000001000f7e28 _PyEval_EvalFrameDefault + 23096
    25  Python                              0x00000001000f1d1e fast_function + 606
    26  Python                              0x00000001000f1fbb call_function + 587
    27  Python                              0x00000001000f7e28 _PyEval_EvalFrameDefault + 23096
    28  Python                              0x00000001000f1390 _PyEval_EvalCodeWithName + 2720
    29  Python                              0x00000001000f1534 PyEval_EvalCode + 100
    30  Python                              0x000000010012ddde PyRun_FileExFlags + 206
    31  Python                              0x000000010012e07f PyRun_SimpleFileExFlags + 447
    32  Python                              0x00000001001475c0 Py_Main + 3712
    33  Python                              0x0000000100000dfe Python + 3582
    34  Python                              0x0000000100000c34 Python + 3124
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6
zadacka commented 6 years ago

Yeah, that's sub-optimal behaviour. Thanks for the detailed notes and video - that should definitely help us track down the problem.

As you can see (below), I can't immediately reproduce your issue, so am going to have to ask for a bit of help. image

Based on what you've already supplied, it looks like this could be a known OS X Cocoa Tk bug. There are some additional notes on compatibility and download links for the recommended version of Tcl/Tk here on python.org

If possible, could you try and download the latest Tcl/Tk from the python.org link, and see if that resolves the problem?

If that does not help, then we can move on to the following:

  1. Share a branch with the code you're using so that I can try and run exactly the same thing and see if I can reproduce it on my local machine - it would make things massively easier to investigate.
  2. Determine what version of Tk you're using, and how that compares with my local set-up
  3. etc.
ghost commented 6 years ago

Hi @zadacka! It is strange that your computer work out of the box? Are you copy/pasting the chars on the form? My script don't break if I copy/paste, only if I type it (extra weird).

Also, you were dead on! OS X Cocoa Tk but was the source of the problem. I had to install a custom version of TK from Activestate to work around this problem (recommended by the python website)

The version installed was: ActiveTcl8.5.18.0.298892-macosx10.5-i386-x86_64-threaded.dmg

The link: http://downloads.activestate.com/ActiveTcl/releases/8.5.18.0/

IMHO you could also point to that on the github readme. The information on Python.org about this issue is less than direct about this problem and isn't directly related to easygui, but to TCL/TK and some newbie coders (like me) may generate more issues reports on github about it.

Also, thanks a million for your help mate!

zadacka commented 6 years ago

Great - I'm glad that we were able to identify the cause of the problem here.

It seems crazy to me that the issue hasn't been resolved with more recent OS X builds. The bug has been around since '14, and I would have hoped that Apple would have started shipping a newer Tcl version by now.

Anyhow, kudos on the detailed issue report and detective work!