comparison mercurial/posix.py @ 41523:3ef8bec91465

py3: do a fsdecode(), fsencode() dance in posix.py We have to use `fsdecode()` instead of sysstr() because they are abusing `PyUnicode_EncodeFSDefault()` to get back bytes. Differential Revision: https://phab.mercurial-scm.org/D5808
author Pulkit Goyal <pulkit@yandex-team.ru>
date Sun, 03 Feb 2019 16:38:47 +0530
parents 587a3c976892
children faa04f45b5fe
comparison
equal deleted inserted replaced
41522:d783c937aa53 41523:3ef8bec91465
581 581
582 def groupmembers(name): 582 def groupmembers(name):
583 """Return the list of members of the group with the given 583 """Return the list of members of the group with the given
584 name, KeyError if the group does not exist. 584 name, KeyError if the group does not exist.
585 """ 585 """
586 name = pycompat.sysstr(name) 586 name = pycompat.fsdecode(name)
587 return list(grp.getgrnam(name).gr_mem) 587 return pycompat.rapply(pycompat.fsencode, list(grp.getgrnam(name).gr_mem))
588 588
589 def spawndetached(args): 589 def spawndetached(args):
590 return os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0), 590 return os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0),
591 args[0], args) 591 args[0], args)
592 592