Make _LoggingTee compatible with TextIO#1151
Merged
larsoner merged 4 commits intosphinx-gallery:masterfrom Jul 20, 2023
o-laurent:master
Merged
Make _LoggingTee compatible with TextIO#1151larsoner merged 4 commits intosphinx-gallery:masterfrom o-laurent:master
larsoner merged 4 commits intosphinx-gallery:masterfrom
o-laurent:master
Conversation
4 tasks
Contributor
|
Looks pretty straightforward, complete, and clean -- thanks @o-laurent ! |
Contributor
Author
|
Thanks for your help and for maintaining the library! |
o-laurent
commented
Jul 20, 2023
| assert tee.writable() | ||
|
|
||
|
|
||
| def test_fileno(monkeypatch, log_collector_wrap): |
Contributor
Author
There was a problem hiding this comment.
There's just this useless argument in the test... Sorry!
clrpackages
referenced
this pull request
in clearlinux-pkgs/pypi-sphinx_gallery
Aug 22, 2023
… to version 0.14.0 v0.14.0 ------- **Implemented enhancements:** - MAINT Update backreferences docs and add tests `#1154 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1154>`__ (`lucyleeow <https://github.com/lucyleeow>`__) - Remove extra spaces in reported running time `#1147 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1147>`__ (`stefanv <https://github.com/stefanv>`__) **Fixed bugs:** - MAINT: Fix for Sphinx 7.2 `#1176 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1176>`__ (`larsoner <https://github.com/larsoner>`__) - updated mpl gui warning catcher to new error message `#1160 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1160>`__ (`story645 <https://github.com/story645>`__) - Ensure consistent encoding for md5sum generation `#1159 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1159>`__ (`sdhiscocks <https://github.com/sdhiscocks>`__) - Maint: Fix ``app.builder.outdir`` as Sphinx now using pathlib `#1155 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1155>`__ (`lucyleeow <https://github.com/lucyleeow>`__) - Make \_LoggingTee compatible with TextIO `#1151 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1151>`__ (`o-laurent <https://github.com/o-laurent>`__) (NEWS truncated at 15 lines)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1150.
Following up on the discussion in issue #1150, I'd like to propose this PR to improve the compatibility between _LoggingTee and TextIO. It also includes some tests to keep the coverage complete.
Judging from the previous comments, the non-compatibility was already an issue for other packages (e.g. seaborn). In this PR, the classic attributes of TextIOBase and of IOBase (inherited) are all implemented.
This should prevent further issues on the compatibility between the expected stdout and _LoggingTee. I am, of course, open to reverting to adding only the "encoding" attribute if you find it safer/more appropriate. However, this should not be breaking since I am only adding missing attributes and refactoring previous modifications.
(Sorry for the blank lines issue!)