Martin Panter added the comment:
The socket.makefile(newline=...) parameter only affects text mode, but
StreamRequestHandler’s “rfile” attribute works in byte mode. You could call
makefile or TextIOWrapper yourself, but neither of these options support
reading null-terminated “lines” or
New submission from Thomas Feldmann:
When using `socketserver.StreamRequestHandler` it should be possible to specify
the newline terminator that is passed to `self.connection.makefile()`.
This would be greatly appreciated by many people who have to work with network
packets ending with `\0`.