-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Try expanding user for _open_file_or_url. #4510
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
Conversation
I am -1 on this. I have a philosophy of all magic being shallow. What is the usecase of having this function perform the expansion as opposed to having the user do it when it calls |
Yeah I could see it either way. I think it's convenience. In most minds of most users, |
The magic in this case is also fairly benign. The standard case is still attempted first, and the fallback only works on fnames which are never valid literal paths on any OS I've used. |
This seems to me like a good idea. I don't see any disadvantage. We are using our own |
ok, perhaps I can be convinced, however the error handling will need to be fixed. If neither attempt works, it will only report the failure of the second attempt. We would need proper error messaging. |
Aha, yes that needs fixing. |
Why not always call |
That should be safe too...I was being overly conservative. With that change made, I guess the error handling is fine as is? |
👍 from me |
Try expanding user for _open_file_or_url.
When opening a file, this attempts to expand the userpath if the initial open doesn't succeed.
This enables calls such as
plt.style.use('~/.config/matplotlib/matplotlibrc')
.