[PATCH][BUG] BZR_PLUGIN_PATH='' loads from ~/.bzr.conf/plugins

John A Meinel john at arbash-meinel.com
Mon Jun 27 17:13:49 BST 2005


Martin Pool wrote:

>On 26 Jun 2005, John A Meinel <john at arbash-meinel.com> wrote:
>
>
>>The problem is that it is not possible to set the environment variable,
>>such that no plugins are loaded. The problem is the code:
>>
>>bzrpath = os.environ.get('BZR_PLUGIN_PATH')
>>if not bzrpath:
>>   bzrpath = DEFAULT
>>
>>The problem is that "if not bzrpath" is true both when bzrpath is None,
>>and when it is the empty string.
>>
>>
>
>Thanks, taken.
>
>I vaguely recall something about Windows being unable to distinguish
>empty and unset environment variables.  Is that true?
>
>
No, doing this:
python -c 'import os; print repr(os.environ.get("myvar"))'
None
MYVAR='' python -c 'import os; print repr(os.environ.get("myvar"))'
''

Note that environment variables are case insensitive. This seems to be a
windows thing, because running cygwin python, the above evaluates to
'None' both times. But
myvar='' python -c 'import os; print repr(os.environ.get("myvar"))'
''

Anyway, I wouldn't count on the case insensitivity, but it certainly
looks like python distinguishes None from the empty string.
John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20050627/e88598a7/attachment.pgp 


More information about the bazaar mailing list