Author vstinner
Recipients vstinner
Date 2010-04-18.00:10:32
SpamBayes Score 6.53208e-07
Marked as misclassified No
Message-id <>
Current code of execve() has a bug: it uses the length of the environment variable value in *characters* and not in *bytes* to allocate the "p" buffer. I remember that someone wrote a comment somewhere about that... The result is that the environment variable value is truncated by 1 byte.

Example (copy of
$ cat
# -*- coding: utf-8 -*-

import os

env = {"VAR": "ćd"}
os.execve("", [], env)
$ cat

declare -p VAR
$ python2.6
declare -x VAR="ćd"
$ python3.1
declare -x VAR="ć"
Date User Action Args
2010-04-18 00:10:35vstinnersetrecipients: + vstinner
2010-04-18 00:10:34vstinnersetmessageid: <>
2010-04-18 00:10:33vstinnerlinkissue8391 messages
2010-04-18 00:10:32vstinnercreate