On 03/18/2011 05:24 PM, Tres Seaver wrote:
> Could the config file contain an optional hint for finding the "right"
> stdlib in cases where the binary copy had been made?  I realize that
> parsing a config file *without* the stdlib is painful:  perhaps looking
> for a line starting with 'stdlib =' would be enough?

Yes, this was one possible solution I was considering. Two things bother
me about it:

1. It seems... tempting but ill-advised to make it a "fake" ConfigParser
option if in the place where I use it, I'm not actually parsing the file
with full ConfigParser semantics. It might work, but then someone tries
to get clever with a [DEFAULT] section, or interpolation, or who knows
what else, and it breaks mysteriously. That's why I was leaning towards
a specially-tagged comment at the top of the file. Ugly, but at least
not pretending to be something it isn't.

2. I still have to duplicate in C and Python code the logic for finding
the config file in the first place. Or I guess just move it to C and
stash the location in sys or somewhere the Python code can get to it
later. I'd been hoping to avoid this, but oh well...

Carl
_______________________________________________
Distutils-SIG maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to