I am reading the source code for testinfra in the Ansible module. I found the following lines of code:
# Ansible return an unicode object but this is bytes ... # A simple test case is: # >>> assert File("/bin/true").content == open("/bin/true").read() stdout_bytes = b"".join((chr(ord(c)) for c in out['stdout'])) stderr_bytes = b"".join((chr(ord(c)) for c in out['stderr']))
Iterates through stdout , gets the integer serial number of each character and converts it back to a single-character string. But what is the point?
source share