zulip/scripts/lib
Anders Kaseorg 9fc0aa7ffa scripts: Fix exec invocation for in-process virtualenv activation.
activate_this.py has always documented that it should be exec()ed with
locals = globals, and in virtualenv 16.0.0 it raises a NameError
otherwise.

As a simplified demonstration of the weird things that can go wrong
when locals ≠ globals:

    >>> exec('a = 1; print([a])', {}, {})
    [1]
    >>> exec('a = 1; print([a for b in [1]])', {}, {})
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<string>", line 1, in <module>
      File "<string>", line 1, in <listcomp>
    NameError: name 'a' is not defined
    >>> exec('a = 1; print([a for b in [1]])', {})
    [1]

Top-level assignments go into locals, but from inside a new scope like
a list comprehension, they’re read out of globals, which doesn’t work.

Fixes #12030.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
2019-04-16 17:42:44 -07:00
..
third install-yarn: Fix buggy status check for the signature. 2018-04-09 15:09:37 -07:00
__init__.py Factor out venv-creating code from provision.py. 2016-06-21 11:25:41 -07:00
build-pgroonga provision: Refactor handling of dependencies for building pgroonga. 2019-03-08 15:12:56 -08:00
build-tsearch-extras build-tsearch-extras: Add support for Debian/Ubuntu. 2019-03-08 15:12:56 -08:00
cd_exec scripts: Add cd_exec library helper. 2017-07-21 17:28:20 -07:00
certbot-maybe-renew Use #!/usr/bin/env for bash shebangs. 2018-12-17 17:21:08 -08:00
check-upstart Use #!/usr/bin/env for bash shebangs. 2018-12-17 17:21:08 -08:00
clean-unused-caches scripts: Remove unused imports. 2019-02-02 17:02:58 -08:00
clean_emoji_cache.py scripts: Remove unused imports. 2019-02-02 17:02:58 -08:00
clean_node_cache.py scripts: Remove unused imports. 2019-02-02 17:02:58 -08:00
clean_venv_cache.py scripts: Remove unused imports. 2019-02-02 17:02:58 -08:00
create-production-venv setup_virtualenv: Do not activate the virtualenv on creation. 2019-01-31 17:55:04 -08:00
create-thumbor-venv create-thumbor-venv: Generalize to CentOS, Fedora, RHEL. 2019-01-07 18:52:27 -08:00
email-mirror-postfix email-mirror-postfix: Replace optparse with argparse. 2017-11-21 21:34:38 -08:00
hash_reqs.py docs: Add documentation for `if False` mypy pattern in scripts. 2018-12-17 11:12:53 -08:00
install Revert "install: Ensure that sudo is installed." 2019-04-04 16:52:20 -07:00
install-node install-node: Upgrade yarn to 1.15.2. 2019-04-14 22:36:14 -07:00
install-shellcheck Use #!/usr/bin/env for bash shebangs. 2018-12-17 17:21:08 -08:00
node_cache.py scripts: Remove unused imports. 2019-02-02 17:02:58 -08:00
process-mobile-i18n Enable pycodestyle W605 (invalid escape sequence). 2018-07-03 16:54:46 +02:00
pythonrc.py scripts: Remove import print_function. 2017-09-29 15:43:30 -07:00
queue_workers.py scripts: Remove import print_function. 2017-09-29 15:43:30 -07:00
setup-apt-repo provision: Add provision support for Ubuntu 18.10. 2019-03-09 16:01:46 -08:00
setup-apt-repo-debathena Use #!/usr/bin/env for bash shebangs. 2018-12-17 17:21:08 -08:00
setup-yum-repo setup-yum-repo: Add prod flag for doing IUS install on CentOS. 2019-01-05 15:49:02 -08:00
setup_path_on_import.py scripts: Fix exec invocation for in-process virtualenv activation. 2019-04-16 17:42:44 -07:00
setup_venv.py setup_venv: Remove virtualenv-clone legacy upgrade code. 2019-03-04 15:32:15 -08:00
unpack-zulip scripts/lib/unpack-zulip: Avoid shelling out for rm, mv, mkdir, ln. 2018-11-28 17:48:23 -08:00
upgrade-zulip scripts: Remove unused imports. 2019-02-02 17:02:58 -08:00
upgrade-zulip-from-git scripts: Remove unused imports. 2019-02-02 17:02:58 -08:00
upgrade-zulip-stage-2 scripts: Remove unused imports. 2019-02-02 17:02:58 -08:00
zulip_tools.py get_dev_uuid_var_path: Fix theoretical shell quoting problem. 2019-03-04 15:20:07 -08:00