[New-bugs-announce] [issue8603] Create a bytes version of os.environ and getenvb()

STINNER Victor report at bugs.python.org
Mon May 3 10:56:26 CEST 2010


New submission from STINNER Victor <victor.stinner at haypocalc.com>:

As discussed in issue #8514, I propose a bytes version of os.envionb which would be synchronized with os.environ (which is possible thanks to surrogateescape error handler).

I also propose a os.getenvb()->bytes function.

I don't know yet if it's a good idea of not, but my patch accepts both bytes and str for os.environ(b).get() and os.getenv(b)().

antoine> In posixmodule.c, (...) if memory allocation of the bytes
antoine> object fails, we should error out.

I would require to change also the Windows version and the code specific to OS/2. Ok to do that, but after closing this issue ;-) I don't want to change to much things at the same time.

----------
components: Interpreter Core, Library (Lib), Unicode
files: os_environb.patch
keywords: patch
messages: 104825
nosy: Arfrever, ezio.melotti, gregory.p.smith, haypo, lemburg, loewis, pitrou
priority: normal
severity: normal
status: open
title: Create a bytes version of os.environ and getenvb()
versions: Python 3.2
Added file: http://bugs.python.org/file17191/os_environb.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8603>
_______________________________________


More information about the New-bugs-announce mailing list