{"id":20940386,"url":"https://github.com/fedora-python/pathfix","last_synced_at":"2025-08-12T02:34:57.150Z","repository":{"id":82158720,"uuid":"557134058","full_name":"fedora-python/pathfix","owner":"fedora-python","description":"New upstream for pathfix.py tool which has been removed from CPython in version 3.12.","archived":false,"fork":false,"pushed_at":"2022-10-27T09:42:59.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-03-13T03:29:11.107Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fedora-python.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-25T06:17:37.000Z","updated_at":"2023-11-21T01:57:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"6cdf928c-7468-4fcb-a375-f8d2a69a6531","html_url":"https://github.com/fedora-python/pathfix","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/fedora-python/pathfix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-python%2Fpathfix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-python%2Fpathfix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-python%2Fpathfix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-python%2Fpathfix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fedora-python","download_url":"https://codeload.github.com/fedora-python/pathfix/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedora-python%2Fpathfix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269989873,"owners_count":24508774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T23:10:11.245Z","updated_at":"2025-08-12T02:34:57.135Z","avatar_url":"https://github.com/fedora-python.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pathfix\n\nChange the #! line (shebang) occurring in Python scripts.  The new interpreter\npathname must be given with a -i option.\n\nCommand line arguments are files or directories to be processed.\nDirectories are searched recursively for files whose name looks\nlike a python module. Symbolic links are always ignored\n(except as explicit directory arguments).\n\nThe original file is kept as a back-up (with a \"~\" attached to its name),\n-n flag can be used to disable this.\n\nSometimes you may find shebangs with flags such as `#! /usr/bin/env python -si`.\nNormally, pathfix overwrites the entire line, including the flags.\nTo change interpreter and keep flags from the original shebang line, use -k.\nIf you want to keep flags and add to them one single literal flag, use option -a.\n\nUndoubtedly you can do this using find and sed or perl, but this is\na nice example of Python code that recurses down a directory tree\nand uses regular expressions.  Also note several subtleties like\npreserving the file's mode and avoiding to even write a temp file\nwhen no changes are needed for a file.\n\n# Distribution\n\nIn Fedora Linux, this tools is a part of python-rpm-macros RPM package in /usr/lib/rpm directory.\n\n# History\n\nThis tool has been in CPython since version [2.0 (August 1994)](https://github.com/python/cpython/commit/9af22a037fc961b51651324bdd17a43567a688fd)\nuntil [October 2022 and version 3.12](https://github.com/python/cpython/commit/e0ae9ddffe0a708d0d3f5b8cc10488d466fc43c4).\n\nBecause we (Python maintenance team in Red Hat) use this tool in Fedora Linux to [fix shebangs in RPM packages](https://src.fedoraproject.org/rpms/python-rpm-macros/blob/rawhide/f/macros.python#_21)\nwe decided to create a new upstream for it and allow other users to use it and contribute to it.\n\n# License\n\n[Python-2.0.1](https://spdx.org/licenses/Python-2.0.1.html)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedora-python%2Fpathfix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedora-python%2Fpathfix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedora-python%2Fpathfix/lists"}