Python IDLE issue Mac

Hello, whenever I have IDLE open, I can right click a python script in finder and open with IDLE. However, when IDLE is not already open, I get an error message saying “The document could not be opened.IDLE cannot open files in the python script format”. I have already checked system preferences/ privacy settings for Python’s access to documents, and it looks fine. I have seen similar issues online but I am yet to find a solution that works.

Hi Shadow,

Sorry, that is a known bug in IDLE for Mac. I don’t think there is any
work around available except to use an different version.

The bug is here, being worked on. There will soon be a new release
available that fixes the problem. Thank you for your patience.

https://bugs.python.org/issue45641

https://bugs.python.org/issue44828

Looks like the issue is fixed now.

https://bugs.python.org/issue45641

Hi,

I’m experiencing the same problem. The issues referenced above seem to treat a problem with the ‘open and save panel service’, which I can confirm looks to be fixed.

However, when opening a .py file without idle already open I still get the message “The document “XXX.py” could not be opened. IDLE cannot open files in the Python Script format”, then a blank Python Shell window opens.

If I try to open the .py file again, this time with the Python Shell already open, it opens without a problem.

I updated my Mac to Monterey recently and Python was working fine. This problem started occurring when I reinstalled Python to get the newer version.

It’s not a problem that makes it impossible to code, but it is quite annoying. Anyone knows if it’s been worked on?