robertlugg / easygui

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

easygui bring on mac os crash #165

Open XFrankly opened 4 years ago

XFrankly commented 4 years ago

you can recur on the system: mac 10.14.6 the step is this: 1, open IDLE 2, import easygui 3, easygui.msgbox('This is a basic message box.', 'Title Goes Here') 4, the system cancel and log off,when you login again, the python3.6 IDLE was crash. there is not any log.

PrometheusPi commented 4 years ago

I encountered the same problem today: I use MacOS 10.14.6, python 3.8.1 and easygui 0.98.1. When I run the following script

import easygui  
easygui.msgbox("test") 

The user account logs off. Even worse, if I run the script from a full screen terminal, the screen turns gray/black and no interaction with the operating system is possible anymore. Only a hard restart (holding down the power button for several seconds) allows leaving this state.

import easygui  
media = easygui.fileopenbox(title="Choose file to open")

leads to a crash of python - but no log off are freeze.

I installed esaygui via conda as follows:

 conda install -c conda-forge easygui 
PrometheusPi commented 4 years ago

I went through the easygui code and try to reproduce the functionality of msgbox() based on the underlying methods. The issue is not caused by easygui itself but by the used tkinter. The simple script:

import tkinter 
tkinter.Tk()

which is used in GUItk object leads to a log off.

PrometheusPi commented 4 years ago

Most likely related to these issues: http://staging.python.org/download/mac/tcltk/ and seems to be a common issue with specific python an tk versions: https://github.com/ContinuumIO/anaconda-issues/issues/11165 The combination proposed by @TheodoreEhrenborg in this comment seems to work.

zeelsheladiya commented 1 year ago
FILE_PATH = easygui.fileopenbox(msg=f'Please locate the {file_type_name} file',
                                     default=f"*.{FILE_TYPE[file_type_name]}",
                                     filetypes=[f"*.{FILE_TYPE[file_type_name]}"],
                                     multiple=False)

I am also facing the same problem. I was running this piece of code in windows it was working fine. but now I am working on mac it crashing.

Mona-MengLi commented 7 months ago

I'm facing the same problem, after opening the file, the tk window is not closed. that caused the system to crash when call easygui.fileopen again.