W dniu sob, 02.09.2017 o godzinie 23∶05 +0200, użytkownik Michał Górny napisał: > W dniu sob, 02.09.2017 o godzinie 12∶19 -0700, użytkownik Zac Medico > napisał: > > On 09/02/2017 10:46 AM, Michał Górny wrote: > > > dev-python/pycparser-2.18+ exposes a design flaw in dev-python/ply that > > > makes it unable to work with -OO code. Remove the optimizations from > > > Portage shebangs to prevent triggering the issue until we find a proper > > > solution for it. > > > > > > Bug: https://bugs.gentoo.org/628386 > > > --- > > > bin/clean_locks | 2 +- > > > bin/dispatch-conf | 2 +- > > > bin/ebuild | 2 +- > > > bin/emaint | 2 +- > > > bin/env-update | 2 +- > > > bin/portageq | 2 +- > > > tabcheck.py | 2 +- > > > 7 files changed, 7 insertions(+), 7 deletions(-) > > > > > > diff --git a/bin/clean_locks b/bin/clean_locks > > > index 13af06197..fb245972f 100755 > > > --- a/bin/clean_locks > > > +++ b/bin/clean_locks > > > @@ -1,4 +1,4 @@ > > > -#!/usr/bin/python -bO > > > +#!/usr/bin/python -b > > > > The diff shows -O, but the commit messages says -OO, so which one is it > > really? > > Yes, it's a curious problem. -OO is the one breaking it but py<3.5 seems > to be happy to load -OO files with -O: > > $ python2.7 -O -c 'import pycparser; print(pycparser.__file__)' > /usr/lib64/python2.7/site-packages/pycparser/c_parser.py:20: RuntimeWarning: > parsing methods must have __doc__ for pycparser to work properly > class CParser(PLYParser): > /usr/lib64/python2.7/site-packages/pycparser/__init__.pyo > > $ python3.4 -O -c 'import pycparser; print(pycparser.__cached__)' > /usr/lib64/python3.4/site-packages/pycparser/c_parser.py:20: RuntimeWarning: > parsing methods must have __doc__ for pycparser to work properly > class CParser(PLYParser): > /usr/lib64/python3.4/site-packages/pycparser/__pycache__/__init__.cpython-34.pyo > > This doesn't seem to be the case anymore for py3.5+: > > $ python3.5 -O -c 'import pycparser; print(pycparser.__cached__)' > /usr/lib64/python3.5/site-packages/pycparser/__pycache__/__init__.cpython-35.opt-1.pyc
My roundabout thinking here was really silly. I was mistaking -O/-OO for .pyc/.pyo. For the record, the correct explanation: Python < 3.5 supports only either -O or -OO, and compiles both levels to the same .pyo files. So if we compiled the relevant packages with -OO, then -O implicitly meant -OO. -- Best regards, Michał Górny