You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 2.x, the size of C string needed for an environment variable used by
posix_execve was calculated using PyString_GetSize. In 3.0 this is
translated to PyUnicode_GetSize. However, in 3.0 the C string is the
UTF-8 encoded version of the unicode object, which doesn't necessarily
have the same length as what PyUnicode_GetSize reports.
The simplest solution I see is to use strlen() instead.
Activity
Rhamphoryncus commentedon Jun 9, 2008
In 2.x, the size of C string needed for an environment variable used by
posix_execve was calculated using PyString_GetSize. In 3.0 this is
translated to PyUnicode_GetSize. However, in 3.0 the C string is the
UTF-8 encoded version of the unicode object, which doesn't necessarily
have the same length as what PyUnicode_GetSize reports.
The simplest solution I see is to use strlen() instead.
BreamoreBoy commentedon Jul 10, 2010
Any core C developers have any input on this one?
vstinner commentedon Jul 10, 2010
Yes, I fixed it in 3.1 (r80494) and 3.2 (r80421): see issue bpo-8391.