Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let patched sys.stderr.write() and sys.stdout.write() return number o…
…f written bytes On Python 3, a file’s write() method is expected to return the number of written bytes. It’s a bit unclear what do when no data is actually written (log file couldn’t be opened in case of stderr or data is deliberately ignored in case of stdout). I think it’s reasonable in this case to pretend that all passed data was written. If we returned 0, a caller which calls write() repeatedly until all data has been written will end up in an infinite loop.
- Loading branch information