This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Arfrever, gregory.p.smith, vstinner
Date 2010-05-04.11:10:39
SpamBayes Score 0.00180715
Marked as misclassified No
Message-id <>
Bytes program name problem should be splitted in two parts:

 (a)[b'env']) and[b'env'], env={'PATH': '/usr/bin'}): bytes program and unicode environ
 (b) bytes program and bytes environ

Part (a)

(a) would benefit from the creation of os(.path).fsencode() function (issue #8514).

Part (b)

If the creation of os.environb is accepted (#8603), I think that subprocess should also be modified to support pure bytes environ. Mix bytes and unicode variables in env would lead to mojibake and headaches.

So I propose the creation of an "envb" (environment bytes) argument to Popen constructor. (b) would be written as:[b'env'], envb={b'PATH': b'/usr/bin'})


   envb = os.environb.copy()
   envb[b'PATH'] = b'/usr/bin'[b'env'], envb=envb)

(and it will not be possible to define env and envb at the same time)

In this case, we will need a pure bytes version of os.get_exec_path(), and os._execvpe() should have a "bytes environment" mode (add an optional argument).


I have a patch fixing both problems, parts (a) and (b), but the patch depends on os.environb. I prefer to wait until os.environb is accepted to submit my patch.
Date User Action Args
2010-05-04 11:10:41vstinnersetrecipients: + vstinner, gregory.p.smith, Arfrever
2010-05-04 11:10:41vstinnersetmessageid: <>
2010-05-04 11:10:40vstinnerlinkissue8513 messages
2010-05-04 11:10:39vstinnercreate