Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 585060 - python-utils-r1.eclass / distutils: enable installing .opt-1.pyc files for Python 3.5
Summary: python-utils-r1.eclass / distutils: enable installing .opt-1.pyc files for Py...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Python Gentoo Team
URL: http://bugs.python.org/issue27226
Whiteboard:
Keywords:
Depends on:
Blocks: python-3.5-stable
  Show dependency tree
 
Reported: 2016-06-05 05:58 UTC by Michał Górny
Modified: 2016-06-07 04:43 UTC (History)
2 users (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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-06-05 05:58:15 UTC
So before Python 3.5, we had .pyc and common .pyo for -O and -OO. Since 3.5, there's .opt-1.pyc for -O and .opt-2.pyc for -OO. Our current code is causing only the latter to be installed.

The results you can guess -- scripts that are run with -O cause Python to try to re-optimize the installed modules, either resulting in silent permission errors and lack of optimization (acceptable), or runtime writes to /usr (bad).

Components involved that I can think of:

1. dev-lang/python:3.5 -- seems to compile all variants correctly already,

2. distutils -- I will be opening a bug upstream,

3. python-utils-r1.eclass -- should be trivial to patch.

Anything I'm missing?
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-06-05 07:19:14 UTC
Patch to Python 3.5 and python-utils-r1.eclass is now on python-oo-fix branch.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-06-07 04:43:07 UTC
Merged now.

Would be nice if someone tried to convince the Python upstream that it's a real issue and what they did is not good. But I don't have the patience.