1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

wafsamba/symbols: always split Popen output by bytes

In py3, `wafsamba.duplicate_symbols` test may fail:

    ...
    elfpipe = subprocess.Popen(['readelf', '--dynamic', binname], stdout=subprocess.PIPE).stdout
    ...

    File "./buildtools/wafsamba/symbols.py", line 153, in get_libs
        rpath.extend(m.group(1).split(":"))
    TypeError: a bytes-like object is required, not 'str'

Because Popen will always return bytestr even in py3, and ":" is a
unicode str in py3.  Change ":" to b":" to fix.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joe Guo 2019-02-15 11:23:17 +13:00 committed by Andrew Bartlett
parent 8fc04d2ce3
commit 4843a27bbc

View File

@ -146,7 +146,8 @@ def get_libs(bld, binname):
libs.add(m.group(1))
m = re_rpath.search(line)
if m:
rpath.extend(m.group(1).split(":"))
# output from Popen is always bytestr even in py3
rpath.extend(m.group(1).split(b":"))
ret = set()
for lib in libs: