/[Apache-SVN]
ViewVC logotype

Revision 1885656


Jump to revision: Previous Next
Author: futatuki
Date: Mon Jan 18 16:30:27 2021 UTC (3 years, 3 months ago)
Changed paths: 1
Log Message:
mailer.py: Restore Python 2 support.

* tools/hook-scripts/mailer/mailer.py
  ():
    - Absorb difference of import module name.
    - import codecs, to examine equivalence of codecs.
    - Don't import locale.
  (to_bytes): New function to absorb differnce between Python 2 and Python 3.
   Replace occurence of .encode('utf-8') with this whole in this file.
  (to_str): New function to absorb difference between Python 2 and Python 3.
   Replace occurence of .decode('utf-8') with this whole in this file.
  (_stdin): New variable to hold bytes I/O object for stdin
  (_stdout): New variable to hold bytes I/O object for stdout
  (OutputBase.make_subject):
    - Truncate subject by number of bytes, for compatibility before r1884427.
    - Truncate subject on character boundary (don't truncate in the middle of
      multi-byte sequence of a UTF-8 character).
  (StandardOutput.__init__): Use bytes output interface _stdout for
   StandardOutput.write_binary.
  (StandardOutput.wirte):
    - Override this method only if on Python 3 and encoding of stdout is not
      'utf-8'
    - Use sys.stdout.encoding instead of locale.getpreferredencoding().
  (PropChange.generate): Use bytes input interface _stdin.
  (Lock.__init__): Use bytes input interface _stdin.
  (DiffURLSelections._get_url): Remove extra trailing spaces.
  (DiffGenerator.__getitem__): Prepare bytes and str representation of
   base_path, 'base_path_bytes' and 'base_path', then use them properly.


Changed paths

Path Details
Directorysubversion/trunk/tools/hook-scripts/mailer/mailer.py modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26