astral-sh / astral-sh/python-build-standalone
Use simple shebang launcher when the path is not complex
- 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
Assessment
This issue has not been assessed yet.