Greg Ward writes:
About as far as I got was thinking "text files suck for size and performance, and DB or dbm files might not be portable enough".
They're not *bad* for size any more than page alignment in a dbm database. ;-)
This pretty much solves the practical side of "what to do about concurrent access" -- in practice, it's not going to happen much, so don't get too worried about it. It doesn't sound very good for performance, unless all you want is a list of packages installed -- that should be pretty fast (you can get everything you need from a succession of os.listdir() calls).
Tools that need faster access during an operation can build temporary databases to accelerate operation as needed, so I don't see any problems here. I wouldn't expect that to be needed too often.
What I'm a little leery about is using Python code as a data format. It's attractive because we all know the syntax and don't have to write a parser. But using a general-purpose language for *such* a specific, tightly-targeted task seems ... I dunno ... overkill-ish. And I wonder if there are security holes lurking in the concept of using code for system catalog data.
Does anyone else share my reservations (which are vague, ill-defined,
Yes. This stuff should not require any exec or eval. It might be reasonable to use something like the .ini format; this can be handled using ConfigParser. This way we still don't need to write a parser.
-- Fred L. Drake, Jr. <fdrake at acm.org> Corporation for National Research Initiatives