Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Handle TypeError when loading a .spydata file (Variable Explorer) #23812

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions spyder/plugins/variableexplorer/widgets/namespacebrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,14 @@ 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 packages versions used to create "
"the data and the versions installed with the currently "
"selected interpreter. Please check the packages versions "
"used to create the data and their compatibility with the "
"packages versions installed.<br>")
Comment on lines +385 to +391
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
msg = _("Spyder is unable to open the file "
"you're trying to load. This could be caused due to a "
"difference between the packages versions used to create "
"the data and the versions installed with the currently "
"selected interpreter. Please check the packages versions "
"used to create the data and their compatibility with the "
"packages versions installed.<br>")
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
Loading