Title: Difference in _use_fd_functions in shutil.py and test_shutil.py · Issue #119048 · python/cpython · GitHub
Open Graph Title: Difference in _use_fd_functions in shutil.py and test_shutil.py · Issue #119048 · python/cpython
X Title: Difference in _use_fd_functions in shutil.py and test_shutil.py · Issue #119048 · python/cpython
Description: Bug report Bug description: When switching from os.listdir to os.scandir 7 years ago somebody forgot to update the definition of _use_fd_functions in test_shutil together with shutil module. in shutil: _use_fd_functions = ({os.open, os.s...
Open Graph Description: Bug report Bug description: When switching from os.listdir to os.scandir 7 years ago somebody forgot to update the definition of _use_fd_functions in test_shutil together with shutil module. in shu...
X Description: Bug report Bug description: When switching from os.listdir to os.scandir 7 years ago somebody forgot to update the definition of _use_fd_functions in test_shutil together with shutil module. in shu...
Opengraph URL: https://github.com/python/cpython/issues/119048
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Difference in _use_fd_functions in shutil.py and test_shutil.py","articleBody":"# Bug report\n\n### Bug description:\n\nWhen switching from `os.listdir` to `os.scandir` [7 years ago](https://github.com/python/cpython/commit/d4d79bc1ff91b04625c312f0219c89aabcd19ce4) somebody forgot to update the definition of _use_fd_functions in `test_shutil` together with `shutil` module.\n\nin shutil:\n```\n_use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} \u003c=\n os.supports_dir_fd and\n os.scandir in os.supports_fd and\n os.stat in os.supports_follow_symlinks)\n```\n\nin test_shutil:\n```\n _use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} \u003c=\n os.supports_dir_fd and\n os.listdir in os.supports_fd and\n os.stat in os.supports_follow_symlinks)\n```\n\nI believe there is no need to calculate this variable twice so I'm gonna propose a PR where I use the value from shutil.py in its tests. Nobody will ever forget to update both places again.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-157912\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/frenzymadness","@type":"Person","name":"frenzymadness"},"datePublished":"2024-05-14T18:48:16Z","url":"https://github.com/python/cpython/issues/119048"}
| 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:8be8eb0e-0022-2d75-a2e8-9acf198ebe97 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E668:172B92:359DA9A:476C3BD:6B020773 |
| html-safe-nonce | 48b52e53a7c405ec39d0d6df376d67b377d97998b8f953a8d22552ab7b6dce26 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjY4OjE3MkI5MjozNTlEQTlBOjQ3NkMzQkQ6NkIwMjA3NzMiLCJ2aXNpdG9yX2lkIjoiNDIzOTU5MDM0NzQxNzcxNjU5NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6ae7f185b9691954462909d9f274f057a1f1408d1cc62192fb03191b518cc125 |
| hovercard-subject-tag | issue:2296152049 |
| 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/119048/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e3dcf619f5a0e78ec03b490106965a9f3629fd80affdb11a609111af15401ba7/python/cpython/issues/119048 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e3dcf619f5a0e78ec03b490106965a9f3629fd80affdb11a609111af15401ba7/python/cpython/issues/119048 |
| og:image:alt | Bug report Bug description: When switching from os.listdir to os.scandir 7 years ago somebody forgot to update the definition of _use_fd_functions in test_shutil together with shutil module. in shu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | frenzymadness |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width