GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — inspect.signature throws RuntimeError on select.epoll.register · Issue #83685 · python/cpython

inspect.signature throws RuntimeError on select.epoll.register #83685

New issue
Copy link
New issue
Copy link
Closed
Closed
inspect.signature throws RuntimeError on select.epoll.register#83685
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory

Description

@hauntsaninja
hauntsaninja
opened on Jan 31, 2020
Issue body actions
BPO 39504
Nosy @hauntsaninja

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 = None
created_at = <Date 2020-01-31.02:12:38.905>
labels = ['library']
title = 'inspect.signature throws RuntimeError on select.epoll.register'
updated_at = <Date 2020-01-31.02:12:38.905>
user = 'https://github.com/hauntsaninja'

bugs.python.org fields:

activity = <Date 2020-01-31.02:12:38.905>
actor = 'hauntsaninja'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2020-01-31.02:12:38.905>
creator = 'hauntsaninja'
dependencies = []
files = []
hgrepos = []
issue_num = 39504
keywords = []
message_count = 1.0
messages = ['361089']
nosy_count = 1.0
nosy_names = ['hauntsaninja']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue39504'
versions = []

Activity

  1. hauntsaninja commented on Jan 31, 2020

    @hauntsaninja
    hauntsaninja
    on Jan 31, 2020
    ContributorAuthor
    More actions

    From the documentation of inspect.signature it seems we should never have a RuntimeError:

    Raises ValueError if no signature can be provided, and TypeError if that type of object is not supported.
    

    The easiest thing to do is just turn the RuntimeError into a ValueError... but I'll take a deeper look and see if I can actually fix this.

    Traceback below:

    >>> import sys
    >>> sys.version
    '3.8.0 (default, Nov 14 2019, 22:29:45) \n[GCC 5.4.0 20160609]'
    >>> import inspect
    >>> import select
    >>> inspect.signature(select.epoll.register)
    Traceback (most recent call last):
      File "/usr/lib/python3.8/inspect.py", line 2004, in wrap_value
        value = eval(s, module_dict)
      File "<string>", line 1, in <module>
    NameError: name 'EPOLLIN' is not defined
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/usr/lib/python3.8/inspect.py", line 2007, in wrap_value
        value = eval(s, sys_module_dict)
      File "<string>", line 1, in <module>
    NameError: name 'EPOLLIN' is not defined
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.8/inspect.py", line 3093, in signature
        return Signature.from_callable(obj, follow_wrapped=follow_wrapped)
      File "/usr/lib/python3.8/inspect.py", line 2842, in from_callable
        return _signature_from_callable(obj, sigcls=cls,
      File "/usr/lib/python3.8/inspect.py", line 2296, in _signature_from_callable
        return _signature_from_builtin(sigcls, obj,
      File "/usr/lib/python3.8/inspect.py", line 2109, in _signature_from_builtin
        return _signature_fromstr(cls, func, s, skip_bound_arg)
      File "/usr/lib/python3.8/inspect.py", line 2057, in _signature_fromstr
        p(name, default)
      File "/usr/lib/python3.8/inspect.py", line 2039, in p
        default_node = RewriteSymbolics().visit(default_node)
      File "/usr/lib/python3.8/ast.py", line 360, in visit
        return visitor(node)
      File "/usr/lib/python3.8/ast.py", line 445, in generic_visit
        new_node = self.visit(old_value)
      File "/usr/lib/python3.8/ast.py", line 360, in visit
        return visitor(node)
      File "/usr/lib/python3.8/ast.py", line 445, in generic_visit
        new_node = self.visit(old_value)
      File "/usr/lib/python3.8/ast.py", line 360, in visit
        return visitor(node)
      File "/usr/lib/python3.8/inspect.py", line 2031, in visit_Name
        return wrap_value(node.id)
      File "/usr/lib/python3.8/inspect.py", line 2009, in wrap_value
        raise RuntimeError()
    RuntimeError
    
  2. hauntsaninja
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Jan 31, 2020
  3. ezio-melotti
    transferred this issue fromon Apr 10, 2022
  4. hauntsaninja
    added a commit that references this issue on Oct 28, 2022

    pythongh-85267: Improvements to inspect.signature __text_signature__ …

    16ae02e
  5. JelleZijlstra
    added a commit that references this issue on Dec 21, 2022

    gh-85267: Improvements to inspect.signature __text_signature__ handli…

    79311cb
  6. hauntsaninja
    added 2 commits that reference this issue on Dec 21, 2022

    [3.11] pythongh-85267: Improvements to inspect.signature __text_signa…

    14a483c

    [3.10] pythongh-85267: Improvements to inspect.signature __text_signa…

    e34fbcc
  7. JelleZijlstra
    added 2 commits that reference this issue on Dec 21, 2022

    [3.11] gh-85267: Improvements to inspect.signature __text_signature__…

    bee9051

    [3.10] gh-85267: Improvements to inspect.signature __text_signature__…

    919045c
  8. hauntsaninja
    closed this as completedon Dec 24, 2022
  9. iritkatriel
    added a commit that references this issue on Dec 28, 2022

    Merged main into regmachine branch (#50)

    fdc73cb
  10. arhadthedev commented on Feb 9, 2023

    @arhadthedev
    arhadthedev
    on Feb 9, 2023
    Member
    More actions

    Should this bugfix be backported? Asking since it was reported for 3.11 once again, in gh-101717.

  11. hauntsaninja commented on Feb 9, 2023

    @hauntsaninja
    hauntsaninja
    on Feb 9, 2023
    ContributorAuthor
    More actions

    This was backported

    Reacted by Erlend E. Aasland
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.