Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

12Shadow12

macrumors newbie
Original poster
Oct 31, 2021
1
0
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 seen similar issues online but I am yet to find a solution that works.


Unfortunately, I have already checked System Preferences> Privacy settings and I can see Python is granted access to documents. Other posts online suggested this could be an OS issue; I tried upgrading to Monterey but the issue is still present.

I believe this entry from https://bugs.python.org/issue38946 summarises my issue best:

Now just to make things a bit more complicated - sigh: I also tested with the recent python.org installer for the 3.10.0a4 pre-release. The principal difference between the 3.9.1 and 3.10.0a4 versions I tested with is that the 3.9.1 is linked with Tk 8.6.10 while 3.10.0a4 is linked with the just-released Tk 8.6.11. On macOS 11 Big Sur, there is one noticeable difference in behavior between the two. With the macOS 11 Big Sur / 3.10.0a4 / 8.6.11 combo, when double-clicking on a .py file without IDLE.app being active, a message window appears saying that the application cannot open Python Script files but does launch IDLE.app. With IDLE.app now active, double-clicking again on the same file then does cause the file to be opened in an edit window of the active IDLE as expected and double-clicking on other .py files then open edit windows for them as expected. Without more detailed investigation, this appears to be a minor problem (possibly a change in Tk) unrelated to those in this issue other than that it involves double-clicking on .py files but I thought I should mention it here in case someone runs into it before it is resolved.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.