Message104672
Ok, here is a first version of my patch to implement os.environb:
- os.environb is the bytes version of os.environ, both are synchronized
- os.environ(b).data stores bytes keys and values on POSIX (but unicode on Windows)
- create os.getenvb()->bytes
- os.environb and os.getenvb() are not available on Windows nor OS/2
- os.environ(b) et os.getenv(b)() accept both byte and unicode keys: that's maybe a stupid idea, I don't know yet :-)
- fix #8513: subprocess: support bytes program name on POSIX
- create os.fsencode() and os.fsdecode()
The patch is not done (the documentation should be updated), but it's a new step to help the discussion. I didn't tried it on Windows.
I already try twice to write os.environb some months ago, but I failed (it was too complex for me). os.environ and os.environb now share the same "data" dictionary, and their methods converts inputs and outputs if necessary. |
|
Date |
User |
Action |
Args |
2010-04-30 23:03:52 | vstinner | set | recipients:
+ vstinner, lemburg, loewis, gregory.p.smith, ezio.melotti, Arfrever |
2010-04-30 23:03:51 | vstinner | set | messageid: <1272668631.49.0.450830638783.issue8514@psf.upfronthosting.co.za> |
2010-04-30 23:03:50 | vstinner | link | issue8514 messages |
2010-04-30 23:03:49 | vstinner | create | |
|