Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 387253 - dev-python/docutils - ImportError gives confusing message if setuptools is missing
Summary: dev-python/docutils - ImportError gives confusing message if setuptools is mi...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-16 00:11 UTC by Terrel Shumway
Modified: 2013-01-13 17:28 UTC (History)
0 users

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 Terrel Shumway 2011-10-16 00:11:01 UTC
while emerging docutils-0.8.1 I got a confusing error message saying that distutils was not installed.  Further investigation showed that in fact setuptools was missing (I didn't run python-updater after installing 3.2).

I was about to submit this patch to upstream, when I discovered that the setuptools reference was added by the ebuild.

--- setup.py.orig	2011-08-30 01:02:28.000000000 -0600
+++ setup.py	2011-10-15 17:39:44.183012148 -0600
@@ -6,7 +6,7 @@
 import os
 import glob
 try:
-    from distutils.core import setup, Command
+    from setuptools import setup, Command
     from distutils.command.build import build
     from distutils.command.build_py import build_py
     if sys.version_info >= (3,):
@@ -15,8 +15,9 @@
     from distutils.command.install_data import install_data
     from distutils.util import convert_path
     from distutils import log
-except ImportError:
-    print ('Error: The "distutils" standard module, which is required for the ')
+except ImportError as e:
+    mod = e.args[0].rsplit(" ",1)[1]
+    print ('Error: The %r module, which is required for the ' %(mod,))
     print ('installation of Docutils, could not be found.  You may need to ')
     print ('install a package called "python-devel" (or similar) on your ')
     print ('system using your package manager.')


 


Reproducible: Always

Steps to Reproduce:
0. emerge setuptools
1. emerge a new version (slot) of python (e.g. 3.2)
2. don't run python-updater
3. emerge docutils-0.8.1

Actual Results:  
step 3 produces confusing error message saying distutils is not found.

Expected Results:  
error message should say that setuptools is not found, and suggest running python-updater

I would suggest that the ebuild should replace the sed command in src_prepare (line 37) with a real patch.

Very few people will ever run into this, so maybe it isn't worth fixing beyond documenting it here.
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2011-10-18 16:23:57 UTC
setuptools is in DEPEND so it shouldn't be missing in the first place, but the patch looks useful.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-01-13 17:28:29 UTC
Now that both ebuilds use -r1 eclasses, it should not happen anymore.