Title: Bug(?): `GzipFile` typing incompatible with `io.TextIOWrapper` · Issue #11418 · python/typeshed · GitHub
Open Graph Title: Bug(?): `GzipFile` typing incompatible with `io.TextIOWrapper` · Issue #11418 · python/typeshed
X Title: Bug(?): `GzipFile` typing incompatible with `io.TextIOWrapper` · Issue #11418 · python/typeshed
Description: Please see the below code with Python 3.12: import gzip import io def gzip_to_list(file: gzip.GzipFile) -> list[str]: with io.TextIOWrapper(buffer=file) as f: return list(f) Running mypy==1.8.0, I get this error message: a.py:6:34: error...
Open Graph Description: Please see the below code with Python 3.12: import gzip import io def gzip_to_list(file: gzip.GzipFile) -> list[str]: with io.TextIOWrapper(buffer=file) as f: return list(f) Running mypy==1.8.0, I ...
X Description: Please see the below code with Python 3.12: import gzip import io def gzip_to_list(file: gzip.GzipFile) -> list[str]: with io.TextIOWrapper(buffer=file) as f: return list(f) Running mypy==1.8.0,...
Opengraph URL: https://github.com/python/typeshed/issues/11418
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug(?): `GzipFile` typing incompatible with `io.TextIOWrapper`","articleBody":"Please see the below code with Python 3.12:\r\n\r\n```python\r\nimport gzip\r\nimport io\r\n\r\n\r\ndef gzip_to_list(file: gzip.GzipFile) -> list[str]:\r\n with io.TextIOWrapper(buffer=file) as f:\r\n return list(f)\r\n```\r\n\r\nRunning `mypy==1.8.0`, I get this error message:\r\n\r\n```none\r\na.py:6:34: error: Argument \"buffer\" to \"TextIOWrapper\" has incompatible type \"GzipFile\"; expected \"IO[bytes]\" [arg-type]\r\n```\r\n\r\nHowever, running this code, it actually works fine.\r\n\r\nI am thinking this is a typeshed bug, but I am not 100% positive. https://github.com/python/typeshed/issues/5491 and https://github.com/python/typeshed/issues/6061 are possibly related","author":{"url":"https://github.com/jamesbraza","@type":"Person","name":"jamesbraza"},"datePublished":"2024-02-13T23:59:53Z","url":"https://github.com/python/typeshed/issues/11418"}
| 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:d998ff84-c76f-8422-4f27-00e96fdcec46 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD56:3E987B:1DF946:2887E2:6B002226 |
| html-safe-nonce | c97ab850fa01d5a06c62286f79839c5f2fa6833530dc1c714ca3a0559655db17 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDU2OjNFOTg3QjoxREY5NDY6Mjg4N0UyOjZCMDAyMjI2IiwidmlzaXRvcl9pZCI6IjMzMzc3MzA5MzQzODgzODE0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3b1a25039605fa3adfa4f068ce2db1284213c4ae6763dec872f168014d2bd67e |
| hovercard-subject-tag | issue:2133322806 |
| 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/typeshed/11418/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a8b64dc4d156056763874ba7e923c0d1fd44d74b0c7b5ccf4a88b74139cccbcc/python/typeshed/issues/11418 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a8b64dc4d156056763874ba7e923c0d1fd44d74b0c7b5ccf4a88b74139cccbcc/python/typeshed/issues/11418 |
| og:image:alt | Please see the below code with Python 3.12: import gzip import io def gzip_to_list(file: gzip.GzipFile) -> list[str]: with io.TextIOWrapper(buffer=file) as f: return list(f) Running mypy==1.8.0, I ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jamesbraza |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| 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 | 44c658b24abf00491fb7ae5f56d42c9f38cbeab2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width