Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Fix unit test logging with python3 #31156

Closed
wants to merge 1 commit into from

Commits on Jan 7, 2020

  1. test: Fix unit test logging with python3

    A logfile must be opened as a text file and encoding is specified.
    Then it can accept a string. Current behaviour we get,
    
     Message: 'ok 2834 sequential/test-worker-prof'
     Arguments: ()
     --- Logging error ---
     Traceback (most recent call last):
       File "/usr/lib64/python3.7/logging/__init__.py", line 1037, in emit
         stream.write(msg + self.terminator)
     TypeError: a bytes-like object is required, not 'str'
     Call stack:
       File "tools/test.py", line 1734, in <module>
         sys.exit(Main())
       File "tools/test.py", line 1710, in Main
         if RunTestCases(cases_to_run, options.progress, options.j, options.flaky_tests):
       File "tools/test.py", line 933, in RunTestCases
         return progress.Run(tasks)
       File "tools/test.py", line 141, in Run
         self.RunSingle(False, 0)
       File "tools/test.py", line 202, in RunSingle
         self.HasRun(output)
       File "tools/test.py", line 365, in HasRun
         logger.info('  ---')
    AdamMajer committed Jan 7, 2020
    Configuration menu
    Copy the full SHA
    fda3766 View commit details
    Browse the repository at this point in the history