Skip to content

Commit

Permalink
Merge pull request #23812 from dalthviz/fixes_issue_22972
Browse files Browse the repository at this point in the history
PR: Handle `TypeError` when loading a `.spydata` file (Variable Explorer)
  • Loading branch information
ccordoba12 authored Feb 26, 2025
2 parents 1b3fe16 + 462ada4 commit 0246680
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 0246680

Please sign in to comment.