]> arthur.barton.de Git - bup.git/commit
Move pwd grp functions to pwdgrp module; require binary fields
authorRob Browning <rlb@defaultvalue.org>
Sun, 20 Oct 2019 17:49:14 +0000 (12:49 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 1 Dec 2019 19:10:35 +0000 (13:10 -0600)
commite861537c86a6b25b39a093342408d0e222f32afc
treeb805835eb1cc32717875d88c9aa5b970daec7272
parent88b26b6847ed42ee1c8108ed91dc5c151705044a
Move pwd grp functions to pwdgrp module; require binary fields

Move the pwd and grp related functions in helpers to a new more
focused pwdgrp module and adjust them (for py3) to require and provide
binary (bytes) values for the appropriate fields: name, passwd, etc.
These fields are arbitrary bytes with no encoding information on
platforms like Linux and *BSD, so must be handled that way.

Create our own Passwd and Group classes to carry the data, and make
them __slots__ based since they're quite a lot smaller, even than
namedtuples:
https://justmachinelearning.com/2019/07/29/python-consumes-a-lot-of-memory-or-how-to-reduce-the-size-of-objects/

See the DESIGN section on Python 3 strings for additional information.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
cmd/get-cmd.py
cmd/save-cmd.py
cmd/split-cmd.py
lib/bup/git.py
lib/bup/helpers.py
lib/bup/metadata.py
lib/bup/pwdgrp.py [new file with mode: 0644]