Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gsutil fails to run when PYTHONSAFEPATH=1 is set #1735

Open
thirtyseven opened this issue Aug 24, 2023 · 1 comment
Open

gsutil fails to run when PYTHONSAFEPATH=1 is set #1735

thirtyseven opened this issue Aug 24, 2023 · 1 comment

Comments

@thirtyseven
Copy link

thirtyseven commented Aug 24, 2023

Host information

Python version: 3.11.x (from Homebrew)
OS: macOS 13.4.1

Steps to reproduce:

export PYTHONSAFEPATH=1
gsutil

Expected output:

Usage: gsutil [-D] [-DD] [-h header]... [-i service_account] [-m] [-o section:flag=value]... [-q] [-u user_project] [command [opts...] args...]
...

Actual output:

Traceback (most recent call last):
  File "/Users/tkaplan/google-cloud-sdk/bin/bootstrapping/gsutil.py", line 15, in <module>
    import bootstrapping
ModuleNotFoundError: No module named 'bootstrapping'

Context

bazel run sets this environment variable when running Python scripts (see https://github.com/bazelbuild/bazel/blob/b70914d269e1ee688a82606e92af6582bf67a56b/tools/python/python_bootstrap_template.txt#L485), this issue makes it difficult to shell out to gsutil from a Python script run by Bazel.

@siddharthab
Copy link

This is also true for gcloud by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants