-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN GH22875 Replace bare excepts by explicit excepts in pandas/io/ #22916
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
Hello @JustinZhengBC! Thanks for submitting the PR.
|
Codecov Report
@@ Coverage Diff @@
## master #22916 +/- ##
=======================================
Coverage 92.18% 92.18%
=======================================
Files 169 169
Lines 50830 50830
=======================================
Hits 46860 46860
Misses 3970 3970
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.
pandas/io/parsers.py
Outdated
@@ -459,7 +459,7 @@ def _read(filepath_or_buffer, kwds): | |||
if should_close: | |||
try: | |||
filepath_or_buffer.close() | |||
except: # noqa: flake8 | |||
except ValueError: # noqa: flake8 |
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 noqa
shouldn't be necessary anymore
pandas/io/packers.py
Outdated
@@ -194,7 +194,7 @@ def read(fh): | |||
if should_close: | |||
try: | |||
path_or_buf.close() | |||
except: # noqa: flake8 | |||
except IOError: # noqa: flake8 |
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 noqa
shouldn't be necessary anymore
@JustinZhengBC any reason to close this PR? I think it was ready to be merged. |
I was trying to get Travis to rebuild by closing and reopening but it turns out that doesn’t work if I previously deleted my fork (which I did after accidentally pushing to master). I have resubmitted it as referenced above. |
git diff upstream/master -u -- "*.py" | flake8 --diff
I removed the except block in pandas/io/pickle.py:172:13 because the only difference between the try block and the except block was one parameter in the call to pc.load, and the parameter that was changing didn't look like it was being used by pc.load.
Original block:
The function it was calling (in pandas/compat/pickle_compat.py):