Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 477764 - sys-apps/portage: sanitize PYTHONPATH for ebuild helpers
Summary: sys-apps/portage: sanitize PYTHONPATH for ebuild helpers
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Portage team
Keywords: InVCS
Depends on:
Blocks: 472632
  Show dependency tree
Reported: 2013-07-22 16:13 UTC by Zac Medico
Modified: 2013-07-26 07:11 UTC (History)
0 users

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


Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2013-07-22 16:13:57 UTC
In the ebuild environment, the PYTHONPATH variable cannot be trusted, since it may can break python. For example:

  $ PYTHONPATH=/usr/lib/python2.7 python3.3
  Fatal Python error: Py_Initialize: Unable to get the locale encoding
    File "/usr/lib/python2.7/encodings/", line 123
      raise CodecRegistryError,\
  SyntaxError: invalid syntax

We can handle this by using a known-safe PORTAGE_PYTHONPATH variable to override PYTHONPATH when calling python helpers.
Comment 2 Zac Medico gentoo-dev 2013-07-26 07:11:55 UTC
This is fixed in 2.1.13 and 2.2.0_alpha189.