astral-sh / astral-sh/python-build-standalone

Use simple shebang launcher when the path is not complex

Open
#397 9 comments 0 reactions 0 assignees View on GitHub
performance
Dominant language
Python
Stars
4.4k
Forks
314
Avg merge
1d 9h
Merged PRs (30d)
27

Description

> Wouldn't it make more sense to have this complicated launcher **only if** the Python path contains a space?
>
> Because the Python startup time is already slow enough, I don't think having two extra processes (per startup) (`dirname` and `realpath`) would help much. (Also it would break if one intends to use this in a minimal container / environment, where the `coreutils` or equivalent aren't present.)
>
> Now I don't exactly know if this launcher should be relocatable, but if so, I think there can be a way to detect in pure POSIX `sh` if the `$0` contains a space, and if so do this, else just leaving it alone.

_Posted by @cipriancraciun in https://github.com/indygreg/python-build-standalone/pull/395#discussion_r1865382901_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.