Skip to content

Commit

Permalink
Adds PYTHONSAFEPATH to python_stub_template.txt
Browse files Browse the repository at this point in the history
See: bazelbuild/rules_python#382

Closes #15701.

PiperOrigin-RevId: 462362643
Change-Id: I80fa61076e43153b2567b7ed68b3280722e85905
  • Loading branch information
groodt authored and copybara-github committed Jul 21, 2022
1 parent a698516 commit f99cebe
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ def Main():
if runfiles_envkey:
new_env[runfiles_envkey] = runfiles_envvalue

# Don't prepend a potentially unsafe path to sys.path
# See: https://docs.python.org/3.11/using/cmdline.html#envvar-PYTHONSAFEPATH
new_env['PYTHONSAFEPATH'] = '1'

# Now look for my main python source file.
# The magic string percent-main-percent is replaced with the filename of the
# main file of the Python binary in BazelPythonSemantics.java.
Expand Down

0 comments on commit f99cebe

Please sign in to comment.