Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 468062 - distutils-r1: PYTHONPATH set in user env causes problems with Python ebuilds
Summary: distutils-r1: PYTHONPATH set in user env causes problems with Python ebuilds
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-30 21:07 UTC by Matthew Thode ( prometheanfire )
Modified: 2024-06-01 09:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-04-30 21:07:49 UTC
when setting a PATHPATH, you cannot emerge python-r1 packages (causes sandbox violations).

setting PYTHONPATH is a common way of installing python packages locally (for testing for instance)

Reproducible: Always

Steps to Reproduce:
export PYTHONPATH="~/.python-apps"
emerge -1 =dev-python/nose-1.1.2-r1
Actual Results:  
sandbox violation when portage tries to install to ~/.python-apps

Expected Results:  
portage ignores the PYTHONPATH var

I think that maybe we should have a generic environment variable that when set will allow portage to use the local environment variables.

'USE="asd" emerge foo'
would become
'LOCAL_PORTAGE_ENV=true USE="asd" emerge foo'
Comment 1 SpanKY gentoo-dev 2013-05-01 18:43:15 UTC
these kind of env vars are not the purview of sandbox

see bug 326887 for the general env topic.  for this particular case, i think that'd be something the python eclasses would want to scrub.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2018-04-21 18:13:27 UTC
Does this still happen?  If so, I will take a look into fitting PYTHONPATH clearing into the eclass.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-05 03:56:04 UTC
commit 2c7d60126fa1d4c4702201d62a1396ce7609de82
Author: Michał Górny <mgorny@gentoo.org>
Date:   Fri Dec 29 17:40:17 2023 +0100

    profiles/info_vars: Add PYTHONPATH

    Signed-off-by: Michał Górny <mgorny@gentoo.org>

(In reply to Michał Górny from comment #2)
> Does this still happen?  If so, I will take a look into fitting PYTHONPATH
> clearing into the eclass.

but yeah, it does
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-06-01 09:25:31 UTC
I'm wondering if we should put a verbose warning somewhere when PYTHONPATH is set in the environment.  On the other hand, I'm not sure if there aren't valid (and safe) cases for doing that, and then users would get unnecessary warnings.