Bug 2090866

Summary: Python: Add -P to default shebangs
Product: [Fedora] Fedora Reporter: Ben Cotton <bcotton>
Component: Changes TrackingAssignee: Python Maintainers <python-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 37CC: bcotton, mhroncok, pviktori, python-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-rpm-macros-3.11-3.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 16:22:28 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2016048    
Bug Blocks: 2016049    

Description Ben Cotton 2022-05-26 18:03:34 UTC
This is a tracking bug for Change: Python: Add -P to default shebangs
For more details, see: https://fedoraproject.org/wiki/Changes/PythonSafePath

The -P flag will be added to the Python shebang macros (%{py3_shbang_opts}, %{py3_shebang_flags}, ...). Packages that adhere to those macros will change their Python shebangs from #! /usr/bin/python3 -s to #! /usr/bin/python3 -sP and as a result, will no longer have the directory of the script (such as /usr/bin) in sys.path. An opt-out mechanism exists.

If you encounter a bug related to this Change, please do not comment here. Instead create a new bug and set it to block this bug.

Comment 2 Miro Hrončok 2022-07-20 15:58:10 UTC
Python Packaging guidelines update: https://pagure.io/packaging-committee/pull-request/1191

Comment 3 Ben Cotton 2022-11-15 16:22:28 UTC
F37 was released today, so I am closing this tracker. If this Change was not completed, please notify me ASAP.