[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: #!/usr/bin/python3 vs virtualenv



Hi all,

On Fri, Mar 03, 2023 at 04:10:50PM +0100, Marc Glisse wrote:
> Hello,
>
> I recently reported
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1032283 , and Dmitry
> suggested discussing it on this mailing list.
>
> Virtual environments work by adding some version of Python (possibly just a
> symlink to the system one) at the beginning of PATH. Debian policy for
> Python scripts is to use #!/usr/bin/python3 and **not** #!/usr/bin/env
> python3, so they are not affected.
>
> I think there are 2 types of Python scripts. The first type is applications
> for end users, like hg or calibre (it is possible that the existence of
> plugins makes my choice of examples a bad one). If I have some strange
> Python virtual environment active, I am happy that the Debian policy
> prevents the virtual environment from breaking those applications (although
> I may still be able to break them with PYTHONPATH).

I want to add that this concern applies to Sphinx too.

Newer versions of its dependencies (e.g. docutils or jinja2) can easily break
Sphinx. As well as incompatible versions of some Sphinx extensions installed
from PyPI.

--
Dmitry Shachnev

Attachment: signature.asc
Description: PGP signature


Reply to: