Skip to content

Commit

Permalink
Backport PR spyder-ide#23812: PR: Handle TypeError when loading a `…
Browse files Browse the repository at this point in the history
….spydata` file (Variable Explorer)
  • Loading branch information
ccordoba12 authored and meeseeksmachine committed Feb 26, 2025
1 parent e93c679 commit 67f3b7a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spyder/plugins/variableexplorer/widgets/namespacebrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,15 @@ def load_data(self, filename, ext):
"<br><br><tt>{extensions}</tt>").format(
extensions=', '.join(IMPORT_EXT))
return msg
except TypeError:
msg = _(
"Spyder is unable to open the file you're trying to load. "
"This could be caused due to a difference between the package "
"versions used when you saved this spydata file and the ones "
"installed in the current environment. Please check the "
"compatibility between them (e.g. that you're using Numpy 2.x "
"in both environments).<br>"
)
except (UnpicklingError, RuntimeError, CommError):
return None

Expand Down

0 comments on commit 67f3b7a

Please sign in to comment.