Within tests, sys.stderr.write does not return the number of characters written as write should.
This originates in EncodedFile.write which returns None, missing a return statement.
A minimal test (needs to be run as a test by pytest):
def test_stderr():
assert sys.stderr.write("A") > 0
I am using pytest 5.2.1 but the code in master is the same.