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.getsource() returns the wrong lines for coroutine functions #68857

Closed
groner mannequin opened this issue Jul 19, 2015 · 3 comments
Closed

inspect.getsource() returns the wrong lines for coroutine functions #68857

groner mannequin opened this issue Jul 19, 2015 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@groner
Copy link
Mannequin

groner mannequin commented Jul 19, 2015

BPO 24669
Nosy @1st1
Files
  • inspect-getsource-asyncdef.patch: Fix with tests
  • 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 2015-07-21.16:05:16.961>
    created_at = <Date 2015-07-19.13:04:29.403>
    labels = ['type-bug', 'library']
    title = 'inspect.getsource() returns the wrong lines for coroutine functions'
    updated_at = <Date 2015-07-21.16:05:16.959>
    user = 'https://bugs.python.org/groner'

    bugs.python.org fields:

    activity = <Date 2015-07-21.16:05:16.959>
    actor = 'yselivanov'
    assignee = 'none'
    closed = True
    closed_date = <Date 2015-07-21.16:05:16.961>
    closer = 'yselivanov'
    components = ['Library (Lib)']
    creation = <Date 2015-07-19.13:04:29.403>
    creator = 'groner'
    dependencies = []
    files = ['39950']
    hgrepos = []
    issue_num = 24669
    keywords = ['patch']
    message_count = 3.0
    messages = ['246940', '247042', '247043']
    nosy_count = 3.0
    nosy_names = ['python-dev', 'yselivanov', 'groner']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue24669'
    versions = ['Python 3.5', 'Python 3.6']

    @groner groner mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jul 19, 2015
    @groner
    Copy link
    Mannequin Author

    groner mannequin commented Jul 19, 2015

    inspect.findsource() looks for lines that start with def. This patch adds a clause to the regex so lines starting with async def will also be recognized.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 21, 2015

    New changeset f02c5bf59fbb by Yury Selivanov in branch '3.5':
    Issue bpo-24669: Fix inspect.getsource() for 'async def' functions.
    https://hg.python.org/cpython/rev/f02c5bf59fbb

    New changeset 6629773fef63 by Yury Selivanov in branch 'default':
    Merge 3.5 (Issue bpo-24669)
    https://hg.python.org/cpython/rev/6629773fef63

    @1st1
    Copy link
    Member

    1st1 commented Jul 21, 2015

    Thanks, Kai!

    @1st1 1st1 closed this as completed Jul 21, 2015
    @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
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant