Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ugly traceback for DistutilsPlatformError #33974

Closed
gward mannequin opened this issue Feb 20, 2001 · 5 comments
Closed

Ugly traceback for DistutilsPlatformError #33974

gward mannequin opened this issue Feb 20, 2001 · 5 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@gward
Copy link
Mannequin

gward mannequin commented Feb 20, 2001

BPO 233259
Nosy @akuchling
Files
  • distutils.platform: Catch DistutilsPlatformError
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/akuchling'
    closed_at = <Date 2002-11-08.16:19:21.000>
    created_at = <Date 2001-02-20.16:23:09.000>
    labels = ['library']
    title = 'Ugly traceback for DistutilsPlatformError'
    updated_at = <Date 2002-11-08.16:19:21.000>
    user = 'https://bugs.python.org/gward'

    bugs.python.org fields:

    activity = <Date 2002-11-08.16:19:21.000>
    actor = 'akuchling'
    assignee = 'akuchling'
    closed = True
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2001-02-20.16:23:09.000>
    creator = 'gward'
    dependencies = []
    files = ['11']
    hgrepos = []
    issue_num = 233259
    keywords = []
    message_count = 5.0
    messages = ['3513', '3514', '3515', '3516', '3517']
    nosy_count = 2.0
    nosy_names = ['akuchling', 'gward']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue233259'
    versions = []

    @gward
    Copy link
    Mannequin Author

    gward mannequin commented Feb 20, 2001

    From Chad Lester:

    I was setting up a new redhat machine, and had forgotten to install the
    python-devel rpm. The distutils provide a fairly ugly stack trace / error
    message. Luckily, it meant something to me... but it's not terribly user
    friendly!

    ...
    File "/usr/lib/python1.5/site-packages/distutils/sysconfig.py", line
    368, in get_config_vars
    func()
    File "/usr/lib/python1.5/site-packages/distutils/sysconfig.py", line
    280, in _init_posix
    raise DistutilsPlatformError, my_msg
    distutils.errors.DistutilsPlatformError: invalid Python
    installation: unable to open /usr/lib/python1.5/config/Makefile (No such
    file or directory)

    @gward gward mannequin closed this as completed Feb 20, 2001
    @gward gward mannequin closed this as completed Feb 20, 2001
    @gward gward mannequin assigned akuchling Feb 20, 2001
    @gward gward mannequin added stdlib Python modules in the Lib dir labels Feb 20, 2001
    @gward
    Copy link
    Mannequin Author

    gward mannequin commented Feb 20, 2001

    This only applies for people installing Distutils
    under Python 1.5.2, so it will only be fixed if
    there is another Distutils release to support 1.5.2 --
    which is unlikely.

    @akuchling
    Copy link
    Member

    Logged In: YES
    user_id=11375

    Greg, I don't understand your last comment on this bug.
    Surely the traceback will still be ugly for people running
    Python 2.2 or whatever who don't have the python-devel RPM
    installed? I don't see how this is only a 1.5.2 or a
    "installing Distutils" question.

    @akuchling
    Copy link
    Member

    Logged In: YES
    user_id=11375

    A simple fix is in the attached patch; it simply adds DistutilsPlatformError to the list of the exception classes caught
    by core.setup().

    However, maybe that exception handler should
    catch DistutilsError, instead of listing a few particular subclasses of it. Some subclasses represent internal errors or a bad setup file, but
    as users can always get the full traceback by setting the DISTUTILS_DEBUG environment variable, there seems little need to
    ever show the full traceback by default.

    @akuchling
    Copy link
    Member

    Logged In: YES
    user_id=11375

    I've checked in my proposed fix (the more liberal version that catches
    all DistutilsError exceptions) as revision 1.54 of distutils/core.py.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant