Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
venv: prepend interpreter directive to argument list
When preparing virtual environments in a file container which has large length, the system might not be able to invoke shebang scripts which define interpreters beyond system limits (e.x. Linux as a limit of 128; BINPRM_BUF_SIZE [1]). This method can be used to check if the executable is a script containing a shebang line [2]. If so, extract the interpreter (and possible optional argument) and prepend the values to the provided argument list. tox will only attempt to read an interpreter directive of a maximum size of 2048 bytes to limit excessive reading and support UNIX systems which may support a longer interpret length. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/include/uapi/linux/binfmts.h?h=linux-4.16.y#n19 [2]: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/tree/fs/binfmt_script.c?h=linux-4.16.y#n24 Signed-off-by: James Knight <[email protected]>
- Loading branch information