-
-
Notifications
You must be signed in to change notification settings - Fork 674
Enable save/load to accept Path objects #41037
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
base: develop
Are you sure you want to change the base?
Enable save/load to accept Path objects #41037
Conversation
edgarcosta
commented
Oct 13, 2025
- The title is concise and informative.
- I have created tests covering the changes.
Documentation preview for this PR (built with commit 8885ac3; changes) is ready! 🎉 |
Ok, it looks good to me, pending whatever those CI jobs are waiting for. |
@sagemath/core please approve workflows. (I guess this shows being added to sagemath/triage doesn't help with getting workflows approved at all.) |
src/sage/misc/persist.pyx
Outdated
""" | ||
Append the .sobj extension to a filename if it doesn't already have it. | ||
""" | ||
s = os.fspath(s) # Convert path-like objects to strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be useless
src/sage/misc/persist.pyx
Outdated
return | ||
|
||
filename = filename[0] | ||
filename = os.fspath(filename) # Convert path-like objects to strings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the comment doesn't add anything meaningful to the code and is pure noise, delete.
This function needs doctest.
make sure if filename is originally a Path then the branch below with fetching URL is never executed.
f916d99
to
73d5d53
Compare
73d5d53
to
8885ac3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok