Remove uses of os.dup2() from run_tests.py in order to adapt the new console
reader and writer on Windows since Python 3.6.

* build/run_tests.py
  (open_logfile): New function returning file-like object which is reassignable
  sys.stdout and sys.stderr.
  (TestHarness.run): Use open_logfile() instead of codecs.open().
  (TestHarness._open_log): Ditto.
  (TestHarness._run_py_test): Reassign sys.stdout and sys.stderr instead of
  uses of os.dup2().

* subversion/tests/cmdline/svntest/main.py
  (LoggingStdoutHandler): New function to use the value of sys.stdout at call
  time.
  (parse_options): Use LoggingStdoutHandler() instead of
  StreamHandler(sys.stdout).

Tested by: jcorvel
Reviewed by: jcorvel
             futatuki


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1883337 13f79535-47bb-0310-9956-ffa450edef68
2 files changed