Title: Windows with_rw-directory TC helper fails to delete repos · Issue #32 · gitpython-developers/gitdb · GitHub
Open Graph Title: Windows with_rw-directory TC helper fails to delete repos · Issue #32 · gitpython-developers/gitdb
X Title: Windows with_rw-directory TC helper fails to delete repos · Issue #32 · gitpython-developers/gitdb
Description: On Windows, os.rmtree cannot not remove directories with read-only files; such are the git db directories. The fix is something like this: ... finally: # Need to collect here to be sure all handles have been closed. It appears # a window...
Open Graph Description: On Windows, os.rmtree cannot not remove directories with read-only files; such are the git db directories. The fix is something like this: ... finally: # Need to collect here to be sure all handles...
X Description: On Windows, os.rmtree cannot not remove directories with read-only files; such are the git db directories. The fix is something like this: ... finally: # Need to collect here to be sure all handles...
Opengraph URL: https://github.com/gitpython-developers/gitdb/issues/32
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Windows with_rw-directory TC helper fails to delete repos","articleBody":"On Windows, `os.rmtree` cannot not remove directories with read-only files; such are the git db directories.\n\nThe fix is something like this:\n\n``` python\n ...\n finally:\n # Need to collect here to be sure all handles have been closed. It appears\n # a windows-only issue. In fact things should be deleted, as well as\n # memory maps closed, once objects go out of scope. For some reason\n # though this is not the case here unless we collect explicitly.\n if not keep:\n gc.collect()\n\n # From http://stackoverflow.com/a/4829285/548792\n def on_rm_error(func, path, exc_info):\n import stat\n os.chmod(path, stat.S_IWRITE)\n func(path)\n\n shutil.rmtree(path, onerror=on_rm_error)\n```\n","author":{"url":"https://github.com/ankostis","@type":"Person","name":"ankostis"},"datePublished":"2016-09-27T19:54:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/32/gitdb/issues/32"}
| 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:265fb409-088c-fb38-9155-663e16cfe045 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 814A:274FD0:34E5DE:498308:696966E4 |
| html-safe-nonce | 84a612b44c0ed973e92030e23a4a7983b9e41858c92fe364533795209b1da994 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MTRBOjI3NEZEMDozNEU1REU6NDk4MzA4OjY5Njk2NkU0IiwidmlzaXRvcl9pZCI6Ijg0MzAxMTM1OTM3OTEyMTg5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5519b97445bb3fc5669f88a76b518b1e2c10f7351be03cd26b55e6634e2ebcb3 |
| hovercard-subject-tag | issue:179595888 |
| 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/gitpython-developers/gitdb/32/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c4b58853f7202080c50149687c4cbaa3a14318c2da04ee8677ede69a47ea1628/gitpython-developers/gitdb/issues/32 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c4b58853f7202080c50149687c4cbaa3a14318c2da04ee8677ede69a47ea1628/gitpython-developers/gitdb/issues/32 |
| og:image:alt | On Windows, os.rmtree cannot not remove directories with read-only files; such are the git db directories. The fix is something like this: ... finally: # Need to collect here to be sure all handles... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ankostis |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/gitdb git https://github.com/gitpython-developers/gitdb.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126093 |
| octolytics-dimension-repository_nwo | gitpython-developers/gitdb |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126093 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/gitdb |
| 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 | ec4d88fbe7ed62446d90b0a6d8e6db4248a8f8b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width