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
Fixed Improper Method Call: __exit__()
#2402
Fixed Improper Method Call: __exit__()
#2402
Conversation
Signed-off-by: fazledyn-or <ataf@openrefactory.com>
Thank you for submitting a pull request (PR) to PlasmaPy! ✨ The future of the project depends on contributors like you, so we deeply appreciate it! 🌱 Our contributor guide has information on:
The bottom of this page shows several checks that are run for every PR. Don't worry if something broke! We break stuff all the time. 😺 Click on "Details" to learn why a check didn't pass. Please also feel free to ask for help. We do that all the time as well. 🌸 You can find us in our chat room or weekly community meeting & office hours. Here are some tips:
If this PR is marked as ready for review, someone should stop by to provide a code review and offer suggestions soon. ✅ If you don't get a review within a few days, please feel free to send us a reminder. Please also use SI units within PlasmaPy, except when there is strong justification otherwise or in some examples. We thank you once again! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2402 +/- ##
=======================================
Coverage 96.91% 96.91%
=======================================
Files 104 104
Lines 9118 9118
=======================================
Hits 8837 8837
Misses 281 281 ☔ View full report in Codecov by Sentry. |
Signed-off-by: fazledyn-or <ataf@openrefactory.com>
Signed-off-by: fazledyn-or <ataf@openrefactory.com>
Signed-off-by: fazledyn-or <ataf@openrefactory.com>
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.
Thank you for making this fix! I had been meaning to look into this further after we added the # noqa
comments, but haven't had a chance. Great catch!
Description
While triaging your project, our bug fixing tool generated the following message(s)-
Proof of Concept / Explanation
Let's take the code example below. We're using a sample HDF5 file from this link.
Output:
However, after changing the
__exit__
method, we get the following output -(env) ataf@openrefactory:~/BFAS/Source/PlasmaPy$ python3 _test.py Before entering context Inside the context After exiting context
If the
HDF5Reader
class is to be used as a context manager, you must change the__exit__
method as suggested in this PR. Otherwise, you can delete both__enter__
and__exit__
methods to avoid confusion.Changes
__exit__
according to documentationPreviously Found & Fixed
CLA Requirements
This section is only relevant if your project requires contributors to sign a Contributor License Agreement (CLA) for external contributions.
All contributed commits are already automatically signed off.
Sponsorship and Support
This work is done by the security researchers from OpenRefactory and is supported by the Open Source Security Foundation (OpenSSF): Project Alpha-Omega. Alpha-Omega is a project partnering with open source software project maintainers to systematically find new, as-yet-undiscovered vulnerabilities in open source code - and get them fixed – to improve global software supply chain security.
The bug is found by running the Intelligent Code Repair (iCR) tool by OpenRefactory and then manually triaging the results.