From Fedora Project Wiki

< Changes

Revision as of 14:11, 10 May 2022 by Churchyard (talk | contribs) (Move the list of macros to detailed description)

Python: Add -P to default shebangs

This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.


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 shbanegs 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.


Current status

  • Targeted release: Fedora Linux 37
  • Last updated: 2022-05-10
  • FESCo issue: <will be assigned by the Wrangler>
  • Tracker bug: <will be assigned by the Wrangler>
  • Release notes tracker: <will be assigned by the Wrangler>

Detailed Description

List of RPM macros that will gain -P

  • %{py3_shbang_opts}
  • %{py3_shbang_opts_nodash}
  • %{py3_shebang_flags}
  • %{py_shbang_opts}
  • %{py_shbang_opts_nodash}
  • %{py_shebang_flags}


Benefit to Fedora


  • Proposal owners:
  • Other developers:
  • Policies and guidelines: N/A (not needed for this Change)
  • Trademark approval: N/A (not needed for this Change)
  • Alignment with Objectives:

Upgrade/compatibility impact

How To Test

User Experience


Contingency Plan

  • Contingency mechanism: (What to do? Who will do it?) N/A (not a System Wide Change)
  • Contingency deadline: N/A (not a System Wide Change)
  • Blocks release? N/A (not a System Wide Change), Yes/No


N/A (not a System Wide Change)

Release Notes