Message104429
| Author |
dabrahams |
| Recipients |
dabrahams, docs@python |
| Date |
2010年04月28日.13:22:12 |
| SpamBayes Score |
6.189903e-09 |
| Marked as misclassified |
No |
| Message-id |
<1272460934.44.0.605237847894.issue8557@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
It's worse than I thought; there isn't even one setting for shell that works everywhere. This is what happens on POSIX (tested on Mac and Ubuntu):
$ mkdir /tmp/xxx
$ cd /tmp/xxx
xxx $ virtualenv /tmp/zzz
xxx $ python
Python 2.6.5 (r265:79063, Mar 23 2010, 08:10:08)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import *
>>> p = Popen(['python', '-c', 'import sys;print sys.executable'],
... stdin=PIPE,stdout=PIPE,stderr=PIPE,
... env={'PATH':'/tmp/zzz/bin'})
>>> stdout,stderr = p.communicate(None)
>>> print stdout
/tmp/zzz/bin/python
>>> print stderr
>>> p = Popen(['python', '-c', 'import sys;print sys.executable'], shell=True,
... stdin=PIPE,stdout=PIPE,stderr=PIPE,
... env={'PATH':'/tmp/zzz/bin'})
>>> stdout,stderr = p.communicate(None)
>>> print stdout
>>> print stderr |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2010年04月28日 13:22:14 | dabrahams | set | recipients:
+ dabrahams, docs@python |
| 2010年04月28日 13:22:14 | dabrahams | set | messageid: <1272460934.44.0.605237847894.issue8557@psf.upfronthosting.co.za> |
| 2010年04月28日 13:22:12 | dabrahams | link | issue8557 messages |
| 2010年04月28日 13:22:12 | dabrahams | create |
|