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

Conversation

dalthviz
Copy link
Member

Description of Changes

Catch TypeError errors when trying to load a } .spydata} file and leave as message a possible reason for the error (having incompatible versions for the packages used to create and load the data/variables)

Issue(s) Resolved

Fixes #22972

Affirmation

By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.

I certify the above statement is true and correct: dalthviz

@dalthviz dalthviz added this to the v6.0.5 milestone Feb 25, 2025
@dalthviz dalthviz self-assigned this Feb 25, 2025
@dalthviz dalthviz changed the title PR: Catch TypeError when loading a .spydata file (Variable Explorer) PR: Handle TypeError when loading a .spydata file (Variable Explorer) Feb 25, 2025
@dalthviz dalthviz changed the title PR: Handle TypeError when loading a .spydata file (Variable Explorer) PR: Handle TypeError when loading a .spydata file (Variable Explorer) Feb 25, 2025
@dalthviz dalthviz marked this pull request as ready for review February 25, 2025 19:41
@dalthviz dalthviz requested a review from ccordoba12 February 25, 2025 19:41
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

Thanks @dalthviz for your work on this!

Comment on lines +385 to +391
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>")
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>"
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Impossible to load .spydata file
2 participants