Yaroslav Halchenko <deb...@onerussian.com> writes:

> WHY Debian's installation of Python decided to diverge from a common
> behavior on other distributions:
> 
> why in a hackish site.py those /usr/local paths are added? 

I don't know what “hackish” means here. I'll assume you are asking
only “why are the ‘/usr/local/foo’ directories in the Python import
search path?”.

> what was the actual use-case they solved? 

As I understand it, the use case is analogous to the addition of
‘/usr/local/bin’ to the ‘PATH’ environment variable in the default
shell profile.

> isn't it more natural for people installing smth under /usr/local

What is ‘smth’? I can't find a package by that name.

> to adjust their PYTHONPATH env variable and be happy without
> interfering with other users of the system they share, who do not
> want to use what is under /usr/local?

Again, the idea of ‘/usr/local’ is that it allows the site
administrator to install files, libraries, binaries, etc. that will
override the OS-installed versions. Adjusting the search path so that
those files are found first is necessary to allow that precedence.

> why should I in my script to take care about infiltration of
> /usr/local away from sys.path to prevent such interference mentioned
> above?

You would need to ask the system administrator who installed files in
that location. Debian, according to Policy, never installs any program
or library in ‘/usr/local’; that's the point.

> why it was hardcoded in the distributed non-configuration site.py,
> which I can't even "configure" to prevent such behavior without
> doing tricks to prevent its automagic 'fix' on every upgrade?

Can't the user who wants to avoid what the system administrator has
deliberately put in place just modify their own ‘PYTHONPATH’
environment variable? Again, analogous to the situation with shell
executable search paths.

> I would suggest my idiosyncratic solution, which imho would remove
> some "magic" and make things transparent and consistent:
> 
> 1. remove /usr/local from site.py

This denies the ability of the system administrator to put local
overrides for Python library files in place as simply and consistently
as is done for other libraries and executables.

> 2. for convenience of users who like to run smth with /usr/local in
>    mind, but hate to tune PYTHONPATH

What is ‘smth’, and how are its users different in their needs for a
consisten search path precedence?

Why are such users to be treated differently from those who override
the ‘PATH’ variable?

> is there anyone else who feels similar way?

Perhaps, but the case has yet to be made why Python should be treated
differently in this regard from so many other parts of the system.

-- 
 \     “I must say that I find television very educational. The minute |
  `\       somebody turns it on, I go to the library and read a book.” |
_o__)                                                    —Groucho Marx |
Ben Finney


-- 
To UNSUBSCRIBE, email to debian-python-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to