Thonny on Mac won't open scripts any more

327 views
Skip to first unread message

charlotte lanvin

unread,
Apr 14, 2023, 3:03:53 PM4/14/23
to thonny
I'm confused. I can't open my python scripts in the IDE any more.
Using Thonny 4.0.2
Python 3.10.9
Tk 8.6.12

I get an internal error message like this one:

Traceback (most recent call last):
  File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/workbench.py", line 189, in __init__
    self._editor_notebook.load_startup_files()
  File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/editors.py", line 791, in load_startup_files
    self.show_file(filename)
  File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/editors.py", line 1043, in show_file
    editor = self.get_editor(filename, True)
  File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/editors.py", line 1134, in get_editor
    return self._open_file(filename_or_id)
  File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/editors.py", line 1116, in _open_file
    if editor._load_file(filename):
  File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/editors.py", line 208, in _load_file
    result = self._load_local_file(filename, keep_undo)
  File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/editors.py", line 244, in _load_local_file
    self.master.remember_recent_file(filename)
  File "/Applications/Thonny.app/Contents/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/thonny/editors.py", line 815, in remember_recent_file
    if filename in recents:
TypeError: argument of type 'NoneType' is not iterable


Andy Piper

unread,
Apr 14, 2023, 5:12:22 PM4/14/23
to thonny
The first thing to ask is - what has changed in your setup? When did the Python scripts stop being able to be opened?

--
You received this message because you are subscribed to the Google Groups "thonny" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thonny+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thonny/61116166-4a45-430c-849a-e939d435dc6an%40googlegroups.com.
--
Sent from Gmail Mobile

charlotte lanvin

unread,
Apr 14, 2023, 5:26:06 PM4/14/23
to thonny
Only Mac OS updates
Tried removing Thonny and reinstalling

Aivar Annamaa

unread,
Apr 15, 2023, 12:45:37 AM4/15/23
to thonny
Charlotte, please select "Tools => Open Thonny data folder", close Thonny, open configuration.ini from that folder and look for the line starting with "recent_files". What does it say at the right hand of the equal sign? After you've taken note of it, delete this line, save configuration and try opening Thonny again.

Please report your findings!

Best regards,
Aivar

charlotte lanvin

unread,
Apr 15, 2023, 7:11:42 AM4/15/23
to thonny
The value was "None"
Removed the line and Thonny seems to work perfectly now.
Thank you Aivar!

PS: is this documented somewhere? I found nothing in the Thonny issues or the wiki on github

Aivar Annamaa

unread,
Apr 28, 2023, 3:14:56 AM4/28/23
to thonny
No, it is not documented because this situation (recent_files = None) is not supposed to happen. It's really weird, because after having analysed the code, I still don't understand how it did happen.

Best regards,
Aivar

Reply all
Reply to author
Forward
0 new messages