From a4172bddc10c1f4cf9997c575d8b07b576d3786a Mon Sep 17 00:00:00 2001 From: "Ignacio R. Morelle" Date: Mon, 14 Aug 2017 13:50:57 -0300 Subject: [PATCH] wmlunits: Fix issue where the process name becomes "w" instead of "wmlunits" The basic string type in Python 3 is equivalent to a wchar_t array, which means that the second byte of every ASCII string is always zero, causing the string to appear truncated after the first character when calling C library functions that expect a single or multibyte encoding (e.g. UTF-8). Just using a byte array does the trick to get a proper single-byte ASCII string. --- data/tools/wmlunits | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/tools/wmlunits b/data/tools/wmlunits index d4744751268a..3881d62d2578 100755 --- a/data/tools/wmlunits +++ b/data/tools/wmlunits @@ -559,7 +559,7 @@ if __name__ == '__main__': try: import ctypes libc = ctypes.CDLL("libc.so.6") - libc.prctl(15, "wmlunits", 0, 0, 0) + libc.prctl(15, b"wmlunits", 0, 0, 0) except: # oh well... pass