Message105080
> @loewis: So do you agree to add os.environb and os.getenvb()?
I agree with the patch (-2) in principle. I think the error handling
needs to improve:
py> os.getenvb('PATH')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/martin/work/3k/Lib/os.py", line 484, in getenvb
return environb.get(key, default)
File "/home/martin/work/3k/Lib/_abcoll.py", line 357, in get
return self[key]
File "/home/martin/work/3k/Lib/os.py", line 400, in __getitem__
value = self.data[self.encodekey(key)]
TypeError: string argument without an encoding
which then leads to the natural, but incorrect
py> os.getenvb('PATH', encoding='ascii')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: getenvb() got an unexpected keyword argument 'encoding'
The first error should remain TypeError, but say something like
"unsupported type string", or "bytes expected".
I notice an incompatible change: posix.environ has now a different
element type. This is probably fine.
There is a couple of white-space only changes in the patch; it would be
good if you could reduce them. |
|
Date |
User |
Action |
Args |
2010-05-05 19:43:24 | loewis | set | recipients:
+ loewis, lemburg, gregory.p.smith, pitrou, vstinner, ezio.melotti, Arfrever |
2010-05-05 19:43:22 | loewis | link | issue8603 messages |
2010-05-05 19:43:21 | loewis | create | |
|