[Twisted-Python] Re: [Twisted-commits] mktap now accepts --uid=0 and --gid=0 to really mean root, has command
glyph at twistedmatrix.com
Wed Mar 5 14:42:51 EST 2003
-----BEGIN PGP SIGNED MESSAGE-----
On Wednesday, March 5, 2003, at 01:33 PM, Tommi Virtanen wrote:
> All I have is this snippet from #twisted, from which I
> understood unconditionally importing pwd to be all ok.
Sorry about that.
> <Tv> Should I wrap it in something to make it optional?
I understood this differently than what you were asking :). Wrapping
and "magic module" objects are sub-optimal for situations like this;
best is to import it only when needed so you get an ImportError if and
only if you try to invoke the functionality that requires pwd on a
platform that doesn't have it.
This should probably be in the coding standard someplace.
We _also_ need a test farm set up so we can tell when people do this
:-). I really need to specify what kind of code needs to work in
Jython; I'm pretty sure I saw some patches recently that moved errno
imports around so that Jython will now fail to run twistd or mktap.
> If you guys want me to move it around so it's not imported
> until needed, I _can_ do that. I'd just like a straight
That would be best, thanks.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)
-----END PGP SIGNATURE-----
More information about the Twisted-Python