FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use the errno attribute of OSError instead of args[0] · Issue #86593 · python/cpython · GitHub

Repository navigation

Use the errno attribute of OSError instead of args[0] #86593

Closed

Description

BPO 42427
Nosy @serhiy-storchaka, @corona10
PRs
  • bpo-42427: Use the errno attribute of OSError instead of args[0] #23449
  • 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 2020-11-22.08:29:33.645>
    created_at = <Date 2020-11-21.17:27:58.861>
    labels = ['type-feature', 'library', '3.10']
    title = 'Use the errno attribute of OSError instead of args[0]'
    updated_at = <Date 2020-11-22.08:29:33.644>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2020-11-22.08:29:33.644>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-11-22.08:29:33.645>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2020-11-21.17:27:58.861>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 42427
    keywords = ['patch']
    message_count = 2.0
    messages = ['381570', '381603']
    nosy_count = 2.0
    nosy_names = ['serhiy.storchaka', 'corona10']
    pr_nums = ['23449']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue42427'
    versions = ['Python 3.10']

    Activity

    1. serhiy-storchaka commented on Nov 21, 2020

      MemberAuthor

      Some code in the stdlib still uses e.args[0] to access errno of OSError instead of e.errno. The latter is more readable, and also it always success (although can return None), but args can be an empty tuple.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Nov 21, 2020
    3. serhiy-storchaka commented on Nov 22, 2020

      MemberAuthor

      New changeset c4d45ee by Serhiy Storchaka in branch 'master':
      bpo-42427: Use the errno attribute of OSError instead of args[0] (GH-23449)
      c4d45ee

    4. transferred this issue fromon Apr 10, 2022
    5. viralmutant commented on Oct 8, 2022

      Does this issue exist in 3.7.3 too ?

      We are observing following traceback, occasionally

      File "urllib3/connectionpool.py", line 444, in _make_request
      File "http/client.py", line 1347, in getresponse
      File "http/client.py", line 307, in begin
      File "http/client.py", line 268, in _read_status
      File "socket.py", line 674, in readinto
      IndexError: tuple index out of range
      

      The strange thing is that the code at line 674 of socket.py is not the readinto method. But since this bug says that args may be empty, then args[0] would explain the error, isn't it ?

    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

      3.10 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions


        Back | FazBrowse Home | New Git URL