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

Aaron Bentley aaron.bentley at utoronto.ca
Mon Jun 27 17:01:53 BST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Harald Meland wrote:
> Keep in mind that we're not talking of any old dict here.
> 
> I think os.environ is kinda special in that all its values are
> (initially, i.e. when the "os" module is first imported) strings:
> 
>   $ foo="" python -c 'import os; print repr(os.environ.get("foo"))'
>   ''

Yeah, it looks like they must always be strings:
>>> os.environ['dog'] = None
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/abentley//lib/python2.3/os.py", line 445, in __setitem__
    putenv(key, item)
TypeError: putenv() argument 2 must be string, not None

> This leads me to suspect that it would only contain e.g. a None-value
> if client code explicitly assigned such a value into the mapping (and
> this wasn't stopped by a putenv() exception).

So even if we assume that os.environ can never contain anything but
strings, I think it's better to treat it like a plain dict as much as
possible.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCwCLx0F+nu1YWqI0RAhCwAJ0UUaacn3DYQSCQpjPvMS1yDzQ2gwCfZ0R4
bf8IlDbHmbOSXg0e3ND4YKY=
=sO3n
-----END PGP SIGNATURE-----




More information about the bazaar mailing list