I haven't looked into this too closely, but it seems that Android's
getgr* fill gr_passwd with a null pointer, mapped to python None, which
is not a bytes.
Since this assert seems to be 100% py3 sanity-checking and bup doesn't
actually use the gr_passwd anywhere, it should be safe to pass the None.
Signed-off-by: Muh Muhten <muh.muhten@gmail.com>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
[rlb@defaultvalue.org: adjust commit message; add origin comment]
__slots__ = 'gr_name', 'gr_passwd', 'gr_gid', 'gr_mem'
def __init__(self, name, passwd, gid, mem):
assert isinstance(name, bytes)
- assert isinstance(passwd, bytes)
+ # None was observed on Android
+ assert isinstance(passwd, bytes) or passwd is None
for m in mem:
assert isinstance(m, bytes)
self.gr_name, self.gr_passwd, self.gr_gid, self.gr_mem = \