-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Support PathLike inputs. #10231
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
Support PathLike inputs. #10231
Conversation
76a5e1c
to
89a130f
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.
miscellaneous comment: if this is intended to support python 2.7 then I suggest changing "file" to "_file" or some such, since "file" is a builtin in python 2. It doesn't feel right to hijack its name.
changed file -> fh. |
b5e9b69
to
aa4ca11
Compare
|
||
The following functions now support `~.PathLike` inputs on Python 3.6+: | ||
On Python 3.6+, `~matplotlib.pyplot.savefig`, `~matplotlib.pyplot.imsave`, | ||
`~matplotlib.pyplot.imread`, and animation writers now accept `~os.PathLike`\s |
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 end of this sentence is a repeat of the beginning.
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.
fixed
PathLike support | ||
```````````````` | ||
|
||
The following functions now support `~.PathLike` inputs on Python 3.6+: |
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.
Not sure you should use ~
since this is an external reference and os.
is pretty short anyway.
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.
fixed
if (format == 'png' | ||
or (format is None | ||
and isinstance(fname, six.string_types) | ||
and fname.lower().endswith('.png'))): |
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 precedence is something changed in another PR, right?
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.
Ah, #10048, I see you linked it.
Hi, I'm using 2.2.0 installed with Anaconda on Jupyter notebook. I'm not sure whether this PR has been already implemented in my version or not, but I came across a related issue to this.
|
fixed in 2.2.1 by #10754. |
PR Summary
My take on PathLike support.
Alternate for #8481; marked as release critical only in the sense that one of the two PRs should go in...
Also xref #10048.
PR Checklist