Navigation Menu

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

inspect.getfile error names module instead of passed class #81354

Closed
flying-sheep mannequin opened this issue Jun 6, 2019 · 7 comments
Closed

inspect.getfile error names module instead of passed class #81354

flying-sheep mannequin opened this issue Jun 6, 2019 · 7 comments
Labels
3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir

Comments

@flying-sheep
Copy link
Mannequin

flying-sheep mannequin commented Jun 6, 2019

BPO 37173
Nosy @terryjreedy, @asvetlov, @flying-sheep, @miss-islington
PRs
  • bpo-37173: Show passed class in inspect.getfile error #13861
  • [3.8] bpo-37173: Show passed class in inspect.getfile error (GH-13861) #13913
  • [3.7] bpo-37173: Show passed class in inspect.getfile error (GH-13861) #13918
  • 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 = None
    closed_at = <Date 2019-06-08.12:15:47.310>
    created_at = <Date 2019-06-06.11:08:14.236>
    labels = ['3.8', 'library', '3.9']
    title = 'inspect.getfile error names module instead of passed class'
    updated_at = <Date 2019-06-08.15:27:09.217>
    user = 'https://github.com/flying-sheep'

    bugs.python.org fields:

    activity = <Date 2019-06-08.15:27:09.217>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-06-08.12:15:47.310>
    closer = 'asvetlov'
    components = ['Library (Lib)']
    creation = <Date 2019-06-06.11:08:14.236>
    creator = 'flying sheep'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37173
    keywords = ['patch']
    message_count = 7.0
    messages = ['344799', '345018', '345032', '345033', '345034', '345043', '345050']
    nosy_count = 4.0
    nosy_names = ['terry.reedy', 'asvetlov', 'flying sheep', 'miss-islington']
    pr_nums = ['13861', '13913', '13918']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37173'
    versions = ['Python 3.8', 'Python 3.9']

    @flying-sheep
    Copy link
    Mannequin Author

    flying-sheep mannequin commented Jun 6, 2019

    Currently, inspect.getfile(str) will report nonsense:

    >>> inspect.getfile(str)
    TypeError: <module 'builtins' (built-in)> is a built-in class

    @flying-sheep flying-sheep mannequin added 3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir labels Jun 6, 2019
    @terryjreedy
    Copy link
    Member

    The correct message would be
    "<class 'str'> is a built-in class"

    We do not backport exception message changes unless 'buggy enough'. I asked on core-mentorship whether this fix qualifies.

    @asvetlov
    Copy link
    Contributor

    asvetlov commented Jun 8, 2019

    I think landing the fix to 3.8 only is just fine

    @asvetlov asvetlov removed the 3.7 (EOL) end of life label Jun 8, 2019
    @miss-islington
    Copy link
    Contributor

    New changeset d407d2a by Miss Islington (bot) (Philipp A) in branch 'master':
    bpo-37173: Show passed class in inspect.getfile error (GH-13861)
    d407d2a

    @asvetlov asvetlov closed this as completed Jun 8, 2019
    @miss-islington
    Copy link
    Contributor

    New changeset c5daae4 by Miss Islington (bot) in branch '3.8':
    bpo-37173: Show passed class in inspect.getfile error (GH-13861)
    c5daae4

    @terryjreedy
    Copy link
    Member

    Right, 3.8 not being released yet makes it different.

    @miss-islington
    Copy link
    Contributor

    New changeset 51c9cc7 by Miss Islington (bot) in branch '3.7':
    bpo-37173: Show passed class in inspect.getfile error (GH-13861)
    51c9cc7

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

    No branches or pull requests

    3 participants