On Wed, Mar 31, 2021 at 11:21 PM Loris Bennett
<
loris....@fu-berlin.de> wrote:
>
> Hi,
>
> I want to get a list of users on a Linux system using Python 3.6. All
> the users I am interested in are just available via LDAP and are not in
> /etc/passwd. Thus, in a bash shell I can use 'getent' to display them.
>
> When I try to install the PyPi package
>
> getent
>
> I get the error
>
> File "/tmp/pip-build-vu4lziex/getent/setup.py", line 9, in <module>
> long_description = file('README.rst').read(),
> NameError: name 'file' is not defined
>
> I duckduckwent a bit and the problem seems to be that 'file' from Python
> 2 has been replaced by 'open' in Python 3.
>
> So what's the standard way of getting a list of users in this case?
>
output. Sometimes that's easier than finding (or porting!) a library.