googletest icon indicating copy to clipboard operation
googletest copied to clipboard

googletest-output-test.py not fully Python3 ready

Open pogo59 opened this issue 2 years ago • 0 comments

Describe the bug

googletest-output-test.py has a feature where you can set the environment variable DEBUG_GTEST_OUTPUT_TEST to get dumps of the output it saw and the output it expected to see. However, setting this caused the script to crash with a Python error along the lines of "a bytes-like object is required."

Steps to reproduce the bug

env DEBUG_GTEST_OUTPUT_TEST=1 ctest -R googletest-output-test -V The -V lets you see the crash; the script will create a file _googletest-output-test_normalized_actual.txt but it is empty.

Does the bug persist in the most recent commit?

yes

What operating system and version are you using?

Ubuntu 18.04

What compiler and version are you using?

Python 3.8.0

What build system are you using?

cmake 3.17.3

Additional context

stackoverflow suggests that adding .encode to the strings being written will solve the problem, and indeed that worked for me.

pogo59 avatar Jul 13 '22 17:07 pogo59