Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 485390 - dev-python/snakeoil: sphinx-build finding hackery relies on Gentoo python wrapping
Summary: dev-python/snakeoil: sphinx-build finding hackery relies on Gentoo python wra...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Brian Dolbec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 484398
  Show dependency tree
 
Reported: 2013-09-19 09:47 UTC by Michał Górny
Modified: 2013-10-10 13:32 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-09-19 09:47:34 UTC
@staticmethod
    def find_sphinx_build():
        # Work our way down from the most explicit, to least explicit.
        for ver in xrange(3, -1, -1):
            ver_info = '.'.join(str(x) for x in sys.version_info[:ver])
            for gentoo_renaming in ('', 'python'):
                p = subprocess.Popen(
                    ['which', 'sphinx-build-%s%s' % (gentoo_renaming, ver_info)],
                    stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                stdout, _ = p.communicate()
                if p.wait() == 0:
                    return stdout.decode().strip()
        raise Exception("Couldn't find sphinx-build w/in PATH=%r" % os.environ.get('PATH'))


which is 1) terribly ugly, 2) is completely broken on non-Gentoo, 3) is completely broken with python-exec:2.

You should really trust the wrapper choosing the correct version. Or *at least* fallback to plain 'sphinx-build' when all your attempts fail.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-10 13:32:10 UTC
This is fixed in 0.5.3.