• C
    avocado.utils.process: attempt first to decode bytes into text · 79d99673
    Cleber Rosa 提交于
    And only if the method is not available, attempt to fallback to
    the stdout itself if it is a string.
    
    Before 30617c1e, the following kind of check was done:
    
       >>> type(bytes('foo')) in string_types
       False
    
    And after it, the check was changed to:
    
       >>> isinstance(bytes('foo'), string_types)
       True
    
    That made the bytes decoding not to be performed at times.  While the
    new check is correct, we should favor the attempt to decode, and
    only if not available, fallback to the original stdout if it looks
    like a string.
    Signed-off-by: NCleber Rosa <crosa@redhat.com>
    79d99673
test_utils_process.py 16.1 KB