Author eric.snow
Recipients Arfrever, eric.snow, mattheww, merwok, ncoghlan, pitrou
Date 2012-05-26.22:20:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1338070832.83.0.303472803469.issue13475@psf.upfronthosting.co.za>
In-reply-to
Content
> Before this is assigned a short option form, I would like to ask
> whether anybody but experts will be able to make a proper use of this
> option.

Do you mean relative to a long form?  And what would constitute improper use for the option?

As Nick noted earlier in this issue, the implicit setting of sys.path[0] is a convenience for some cases, and I can appreciate that.  My complaint is that it is not an obvious behavior.  Furthermore, in an import system that has eliminated implicit relative imports it can lead to confusing behavior.  I consider Nick's proposal the best solution given the constraints we have.

If people do not use it, the status quo is unaffected.  If they do use it, they will be explicitly affecting sys.path[0].  If they use it without knowing what it's for, it will at worst cause imports to happen from unexpected sources (or not happen at all).  To me this doesn't seem that different from the way things are now when someone doesn't understand about sys.path[0] initialization.

> (I also don't understand what it adds over PYTHONPATH)

It provides an explicit alternative to the default implicit insertion to sys.path[0].  If the default behavior were no implicit initialization, then I'd agree that PYTHONPATH is sufficient.

> As for the patch, it lacks error checking when calling C API
> functions.

Ah, yes.  Spaced it.  Patch updated (and warnings fixed).

This brings me to ask what the behavior should be when we have errors come back from those C API functions?  In the patch I just have it fall back to the default sys.path[0] behavior.  However, wouldn't an error indicate a deeper problem?  If so, shouldn't Py_FatalError() be called?
History
Date User Action Args
2012-05-26 22:20:33eric.snowsetrecipients: + eric.snow, ncoghlan, pitrou, mattheww, merwok, Arfrever
2012-05-26 22:20:32eric.snowsetmessageid: <1338070832.83.0.303472803469.issue13475@psf.upfronthosting.co.za>
2012-05-26 22:20:32eric.snowlinkissue13475 messages
2012-05-26 22:20:31eric.snowcreate