mirror of https://github.com/zulip/zulip.git
Fix buggy #! lines using "/usr/bin/env python2.7 -u".
The #! line processing interpreted the argument to pass to `env` as "python2.7 -u", which obviously isn't a real program. We fix this by setting the PYTHONUNBUFFERED environment variable inside the program, which has the same effect. Thanks to Dan Fedele for the bug report and suggested solution!
This commit is contained in:
parent
ac35d26868
commit
7395003e6a
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2.7 -u
|
#!/usr/bin/env python2.7
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -6,6 +6,8 @@ import datetime
|
||||||
import tempfile
|
import tempfile
|
||||||
import glob
|
import glob
|
||||||
|
|
||||||
|
os.environ["PYTHONUNBUFFERED"] = "y"
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', ".."))
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..', ".."))
|
||||||
from zulip_tools import DEPLOYMENTS_DIR, FAIL, ENDC, make_deploy_path
|
from zulip_tools import DEPLOYMENTS_DIR, FAIL, ENDC, make_deploy_path
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2.7 -u
|
#!/usr/bin/env python2.7
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -6,6 +6,8 @@ import logging
|
||||||
import shutil
|
import shutil
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
os.environ["PYTHONUNBUFFERED"] = "y"
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||||
from zulip_tools import DEPLOYMENTS_DIR, LOCK_DIR, FAIL, WARNING, ENDC, \
|
from zulip_tools import DEPLOYMENTS_DIR, LOCK_DIR, FAIL, WARNING, ENDC, \
|
||||||
su_to_zulip
|
su_to_zulip
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
#!/usr/bin/env python2.7 -u
|
#!/usr/bin/env python2.7
|
||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
os.environ["PYTHONUNBUFFERED"] = "y"
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..'))
|
||||||
from zulip_tools import FAIL, WARNING, ENDC, su_to_zulip
|
from zulip_tools import FAIL, WARNING, ENDC, su_to_zulip
|
||||||
|
|
||||||
|
|
|
@ -12,4 +12,5 @@ esac
|
||||||
cd "$(dirname "$0")"/..
|
cd "$(dirname "$0")"/..
|
||||||
./tools/generate-fixtures
|
./tools/generate-fixtures
|
||||||
# "-u" uses unbuffered IO, which is important when wrapping it in subprocess
|
# "-u" uses unbuffered IO, which is important when wrapping it in subprocess
|
||||||
/usr/bin/env python2.7 -u ./manage.py test "$target" --settings=zproject.test_settings "$@"
|
export PYTHONUNBUFFERED="y"
|
||||||
|
/usr/bin/env python2.7 ./manage.py test "$target" --settings=zproject.test_settings "$@"
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2.7 -u
|
#!/usr/bin/env python2.7
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
|
@ -7,6 +7,8 @@ import datetime
|
||||||
import shutil
|
import shutil
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
os.environ["PYTHONUNBUFFERED"] = "y"
|
||||||
|
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
from zulip_tools import DEPLOYMENTS_DIR, LOCK_DIR, FAIL, WARNING, ENDC, make_deploy_path
|
from zulip_tools import DEPLOYMENTS_DIR, LOCK_DIR, FAIL, WARNING, ENDC, make_deploy_path
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue