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: togithub.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:e6a1ac2c-8fa0-48f0-c224-f3be0c527d84 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B660:4F147:AED3D1:EAE08E:696981B0 |
| html-safe-nonce | 50218abecdde35ff0201aacfc72aee912a683272ca9d0074656f69f833eb02a1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNjYwOjRGMTQ3OkFFRDNEMTpFQUUwOEU6Njk2OTgxQjAiLCJ2aXNpdG9yX2lkIjoiNzYyODA4OTc1MDI5OTcwNTc3NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a1c041aee563c48739fffe7ecdc5368e58118e6352f9a9d47482da727296a01d |
| 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 | f33e4b94c8824ab2b434d82a94139432fb5ebee9df4b75304140ad22508c4a77 |
| 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 | 48f380098b30acbb700b04f1724481ca10d574fc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width