-
Notifications
You must be signed in to change notification settings - Fork 27
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
Allow PathLike objects #92
Conversation
Congratulations 🎉. DeepCode analyzed your code in 6.66 seconds and we found no issues. Enjoy a moment of no bugs ☀️. 👉 View analysis in DeepCode’s Dashboard | Configure the bot |
It appears to me like @stickler-ci does only know python 2 syntax, because it does not know the exception Another thing related to this PR, would you mind, if we stop supporting python 2 and update @stickler-ci to check for python 3 syntax? |
Yes, please do update |
I'd be ok with dropping Python 2 support |
Great, I would propose to align with satpy and set the required python version to |
Go ahead 👍 |
Codecov Report
@@ Coverage Diff @@
## master #92 +/- ##
=========================================
Coverage ? 66.30%
=========================================
Files ? 34
Lines ? 2858
Branches ? 0
=========================================
Hits ? 1895
Misses ? 963
Partials ? 0 Continue to review full report at Codecov.
|
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.
LGTM! Just one question and a typo.
def file_opener(file): | ||
if isinstance(file, io.IOBase) and file.seekable(): | ||
# avoid closing the file using nullcontext | ||
open_file = nullcontext(file) |
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.
Neat!
To satisfy codebeat, I guess we will need a huge refactor of the |
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.
LGTM, thanks for implementing this.
This PR allows pygac to open
PathLike
objects, that provide anopen
method.This is motivated by the new satpy feature from pytroll/satpy#1439 and the subsequent PR pytroll/satpy#1470, where @sfinkens asked to move the implementation to pygac.