try to fix error where modules writing directly to sys.stdout.buffer blow up #276
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.
Handle error case (due to using python-subunit + unittest-xml-reporting) where sys.stdout has no buffer attribute, causing a failure and hang in subunit:
protocol = TestProtocolServer(result, self._passthrough, self._forward)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/subunit/init.py", line 510, in init
stream = sys.stdout.buffer
^^^^^^^^^^^^^^^^^
AttributeError: '_DuplicateWriter' object has no attribute 'buffer'
This is due to python-subunit setting "stream = sys.stdout.buffer", but _DuplicateWriter() has no buffer attriibute. I tried handling this in a PR in python-subunit module, but they weren't really having it: testing-cabal/subunit#56
This works from what I can tell and doesn't seem to have negative side effects...
I also fixed tox.ini to work properly with Tox4, as it was not as-is.
test-results.zip