This is an archive of the discontinued Mercurial Phabricator instance.

debugcommands: move away from line buffered output on binary stream
ClosedPublic

Authored by indygreg on Jan 18 2020, 4:18 PM.

Details

Summary

Line buffering on binary file objects is apparently undefined behavior
in Python and emits a RuntimeWarning on Python 3.8. See
https://bugs.python.org/issue32236.

This commit changes the I/O logging file descriptor from line
buffered to unbuffered to work around this. I'm no fan of
unbuffered I/O for performance reasons. But I don't think it
is an issue here given the nature of the code.

With this change, test-ssh-proto.t now passes on Python 3.8.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.