Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 585060

Summary: python-utils-r1.eclass / distutils: enable installing .opt-1.pyc files for Python 3.5
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: EclassesAssignee: Python Gentoo Team <python>
Status: RESOLVED FIXED    
Severity: normal CC: itumaykin+gentoo, jcallen
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://bugs.python.org/issue27226
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 576742    

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.