There's a bug in issue_command() because the len() argument sent to the driver may be different from the actual length of the string.
This is relevant to this line in the code
Take an example where *args is a single argument of value 北京 (that is two Chinese characters for the city 'Beijing'. At present, self._writeline(str(len(arg))) will write '2' for the length of this argument. But the following line encodes the character using utf-8 giving a value of b'\xe8\xa5\xbf\xe5\xae\x89'. This is length '6'. This causes all subsequent commands sent to the driver to fail.
Making sure the arg is coded before getting its length fixes this problem
There's a bug in
issue_command()because thelen()argument sent to the driver may be different from the actual length of the string.This is relevant to this line in the code
Take an example where
*argsis a single argument of value北京(that is two Chinese characters for the city 'Beijing'. At present,self._writeline(str(len(arg)))will write '2' for the length of this argument. But the following line encodes the character usingutf-8giving a value ofb'\xe8\xa5\xbf\xe5\xae\x89'. This is length '6'. This causes all subsequent commands sent to the driver to fail.Making sure the
argis coded before getting its length fixes this problem