Skip to content
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

Prevent flush on closed NamedStream #3507

Merged
merged 4 commits into from
Feb 3, 2022
Merged

Prevent flush on closed NamedStream #3507

merged 4 commits into from
Feb 3, 2022

Conversation

IAlibay
Copy link
Member

@IAlibay IAlibay commented Jan 19, 2022

Fixes #3386

Changes made in this Pull Request:

  • Prevents trying to close (or seek) an already closed stream.

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

@codecov
Copy link

codecov bot commented Jan 19, 2022

Codecov Report

Merging #3507 (9b7917d) into develop (d593993) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3507      +/-   ##
===========================================
- Coverage    94.06%   94.06%   -0.01%     
===========================================
  Files          176      176              
  Lines        23282    23284       +2     
  Branches      3302     3303       +1     
===========================================
  Hits         21901    21901              
- Misses        1335     1337       +2     
  Partials        46       46              
Impacted Files Coverage Δ
package/MDAnalysis/lib/util.py 90.46% <100.00%> (-0.26%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d593993...9b7917d. Read the comment docs.

@IAlibay
Copy link
Member Author

IAlibay commented Jan 19, 2022

I think codecov is being weird again - not sure why it thinks there's two extra misses. We can add an issue to raise test coverage for lib later? (it's a simple enough GSoC-starter)


.. versionchanged:: 2.1.0
Calls to ``close()`` will no longer attempt to close or flush the
stream if :attr:`closed` is `True`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't it get pretty verbose if you start adding versionchanged directives for bug fixes as opposed to select new features or API changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I can see that. I'm happy to not include that, I'm tempted to remove the entry from the changelog too if you're good with that?

Copy link
Member

@richardjgowers richardjgowers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@jbarnoud
Copy link
Contributor

jbarnoud commented Feb 3, 2022

Is there anything else than the buggy codecov that prevents this PR from going through?

@IAlibay
Copy link
Member Author

IAlibay commented Feb 3, 2022

Mostly forgot about it 😅

I did wonder if anyone else had any strong opinions about what is essentially hiding some of the __del__ issues we have.

@jbarnoud jbarnoud merged commit 3c0875c into develop Feb 3, 2022
@jbarnoud
Copy link
Contributor

jbarnoud commented Feb 3, 2022

Thank you @IAlibay 😄

@IAlibay IAlibay deleted the issue-3386 branch May 29, 2022 12:55
@IAlibay IAlibay added the defect label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReaderBase.__del__: I/O operation on closed file
4 participants