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

Incosistent error message in asyncio: windows_events / windows_utils #90397

Closed
sobolevn opened this issue Jan 3, 2022 · 4 comments
Closed

Incosistent error message in asyncio: windows_events / windows_utils #90397

sobolevn opened this issue Jan 3, 2022 · 4 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes topic-asyncio type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Jan 3, 2022

BPO 46239
Nosy @asvetlov, @1st1, @miss-islington, @sobolevn
PRs
  • bpo-46239: improve error message when importing asyncio.windows_events #30353
  • [3.10] bpo-46239: improve error message when importing asyncio.windows_events (GH-30353) #30388
  • [3.9] bpo-46239: improve error message when importing asyncio.windows_events (GH-30353) #30389
  • 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 2022-01-04.09:22:40.707>
    created_at = <Date 2022-01-03.09:58:19.520>
    labels = ['3.11', 'type-bug', '3.9', '3.10', 'expert-asyncio']
    title = 'Incosistent error message in asyncio: windows_events / windows_utils'
    updated_at = <Date 2022-01-04.09:22:46.900>
    user = 'https://github.com/sobolevn'

    bugs.python.org fields:

    activity = <Date 2022-01-04.09:22:46.900>
    actor = 'asvetlov'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-01-04.09:22:40.707>
    closer = 'asvetlov'
    components = ['asyncio']
    creation = <Date 2022-01-03.09:58:19.520>
    creator = 'sobolevn'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46239
    keywords = ['patch']
    message_count = 4.0
    messages = ['409571', '409654', '409656', '409657']
    nosy_count = 4.0
    nosy_names = ['asvetlov', 'yselivanov', 'miss-islington', 'sobolevn']
    pr_nums = ['30353', '30388', '30389']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46239'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @sobolevn
    Copy link
    Member Author

    sobolevn commented Jan 3, 2022

    When trying to import both windows_events and windows_utils on non-Windows, they both fail.

    But, they fail differently. windows_utils produces a good error message, whil windows_events produces a strange one.

    Good:

    Python 3.11.0a3+ (heads/main:8d7644fa64, Dec 30 2021, 13:00:40) [Clang 11.0.0 (clang-1100.0.33.16)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import asyncio.windows_utils
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/sobolev/Desktop/cpython/Lib/asyncio/windows_utils.py", line 6, in <module>
        raise ImportError('win32 only')
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ImportError: win32 only
    

    Not so good:

    >>> import asyncio.windows_events
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/sobolev/Desktop/cpython/Lib/asyncio/windows_events.py", line 3, in <module>
        import _overlapped
        ^^^^^^^^^^^^^^^^^^
    ModuleNotFoundError: No module named '_overlapped'
    

    I propose to use the same error message windows_utils does.

    @sobolevn sobolevn added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes topic-asyncio type-bug An unexpected behavior, bug, or error labels Jan 3, 2022
    @asvetlov
    Copy link
    Contributor

    asvetlov commented Jan 4, 2022

    New changeset 5a2a650 by Nikita Sobolev in branch 'main':
    bpo-46239: improve error message when importing asyncio.windows_events (GH-30353)
    5a2a650

    @miss-islington
    Copy link
    Contributor

    New changeset 86d1b8c by Miss Islington (bot) in branch '3.9':
    bpo-46239: improve error message when importing asyncio.windows_events (GH-30353)
    86d1b8c

    @asvetlov
    Copy link
    Contributor

    asvetlov commented Jan 4, 2022

    New changeset cf48a14 by Miss Islington (bot) in branch '3.10':
    bpo-46239: improve error message when importing asyncio.windows_events (GH-30353) (bpo-30388)
    cf48a14

    @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.9 only security fixes 3.10 only security fixes 3.11 only security fixes topic-asyncio type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants