Log Message: |
Follow up to r1884427: mailer.py: Additional fix for Python 3 support
* tools/hook-scripts/mailer/mailer.py
():
- Don't import StringIO.
- import locale for output class 'StandardOutput'.
(main): Don't decode cmd_args[x], because they are already str.
(OutputBase.write_binary): New method, as the abstract base class of
output classes.
(OutputBase.write): Tweak comment. This method has implementation now.
(OutputBase.run): Use self.write_binary() to write content of buf.
(StandardOutput.write): Override default write method to use default
encoding for console output.
(PropChange.generate): Use sys.stdin.buffer instead of sys.stdin to read
from stdin as bytes.
(Lock.__init__):
- Use sys.stdin.buffer instead of sys.stdin to read from stdin as bytes.
- Strip new line character from items of self.dirlist
(DiffGenerator.__getitem__): Pass change.path as is to svn.fs.FileDiff.
(TextCommitRenderer.render): Don't decode data.author. data.author is
already bytes (or None) here.
(Repository.__init__): Ensure self.author is str or None.
((entry routine)): Encode repository path as UTF-8 before canonicalize
explicitly.
Review by: stsp
|