Title: TimeoutError has errno and strerror attributes set to None · Issue #109601 · python/cpython · GitHub
Open Graph Title: TimeoutError has errno and strerror attributes set to None · Issue #109601 · python/cpython
X Title: TimeoutError has errno and strerror attributes set to None · Issue #109601 · python/cpython
Description: Bug report Bug description: According to the docs OSError https://docs.python.org/3/library/exceptions.html#OSError has the attributes errno and strerror (integer and string respectively) set on this class and sub-classes like TimeoutErr...
Open Graph Description: Bug report Bug description: According to the docs OSError https://docs.python.org/3/library/exceptions.html#OSError has the attributes errno and strerror (integer and string respectively) set on th...
X Description: Bug report Bug description: According to the docs OSError https://docs.python.org/3/library/exceptions.html#OSError has the attributes errno and strerror (integer and string respectively) set on th...
Opengraph URL: https://github.com/python/cpython/issues/109601
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TimeoutError has errno and strerror attributes set to None","articleBody":"# Bug report\r\n\r\n### Bug description:\r\n\r\nAccording to the docs `OSError` https://docs.python.org/3/library/exceptions.html#OSError has the attributes `errno` and `strerror` (integer and string respectively) set on this class and sub-classes like `TimeoutError` https://docs.python.org/3/library/exceptions.html#TimeoutError\r\n\r\nAnd the `TimeoutError` is mapped to `errno` https://docs.python.org/3/library/errno.html#errno.ETIMEDOUT which has a default value depending on the OS.\r\n\r\nIs this a bug in how the `TimeoutError` is raised? Or can the attributes be `None` which should be documented?\r\n\r\n```python\r\nimport socket\r\n\r\ns = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\ns.settimeout(0.1)\r\n\r\ntry:\r\n s.connect((\"10.10.10.10\", 22))\r\nexcept OSError as ex:\r\n print(repr(ex))\r\n print(f\"errno is {type(ex.errno)} - {ex.errno}\")\r\n print(f\"strerror is {type(ex.strerror)} - {ex.strerror}\")\r\n\r\n\r\n# But the `FileNotFoundError` has the correct attributes are set\r\n\r\nimport os\r\n\r\ntry:\r\n os.listdir(\"non_existing_path\")\r\nexcept OSError as ex:\r\n print(repr(ex))\r\n print(f\"errno is {type(ex.errno)} - {ex.errno}\")\r\n print(f\"strerror is {type(ex.strerror)} - {ex.strerror}\")\r\n\r\n```\r\n\r\nRef: https://github.com/python/typeshed/issues/9864\r\n\r\n\r\n### CPython versions tested on:\r\n\r\n3.11\r\n\r\n### Operating systems tested on:\r\n\r\nLinux","author":{"url":"https://github.com/aminalaee","@type":"Person","name":"aminalaee"},"datePublished":"2023-09-20T08:14:17Z","url":"https://github.com/python/cpython/issues/109601"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6db5f4b0-5100-2588-b713-4a17ebe1c592 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E53C:2F0104:20377E3:2ACB143:6B004F86 |
| html-safe-nonce | 65e374ce1dcc3d1056d15b8817fb93190c910b36b4ec58f522c669acb4eaf537 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTNDOjJGMDEwNDoyMDM3N0UzOjJBQ0IxNDM6NkIwMDRGODYiLCJ2aXNpdG9yX2lkIjoiMTM0MDQ1NzY3NTY3NDExMTg3OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 381f103f7c4baf85669880a55a3aa2469399e040184e2a7327a5318de16ac9ac |
| hovercard-subject-tag | issue:1904430776 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/109601/issue_layout |
| twitter:image | https://opengraph.githubassets.com/77385eca6aebc8346685cb5a258d2814a1d7dae51445aa31e53e444b3ea8fe20/python/cpython/issues/109601 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/77385eca6aebc8346685cb5a258d2814a1d7dae51445aa31e53e444b3ea8fe20/python/cpython/issues/109601 |
| og:image:alt | Bug report Bug description: According to the docs OSError https://docs.python.org/3/library/exceptions.html#OSError has the attributes errno and strerror (integer and string respectively) set on th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | aminalaee |
| hostname | github.com |
| expected-hostname | github.com |
| None | f420f4996e6b1ff1ccd6d7683f8134f4b5f0f8a50124c210dbfe7490e5644abb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 26e00df917aba0f128135dc073ea0c5e33a70d40 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width