Title: Can't add to index twice in a row in 3.1.25 (PermissionError) · Issue #1395 · gitpython-developers/GitPython · GitHub
Open Graph Title: Can't add to index twice in a row in 3.1.25 (PermissionError) · Issue #1395 · gitpython-developers/GitPython
X Title: Can't add to index twice in a row in 3.1.25 (PermissionError) · Issue #1395 · gitpython-developers/GitPython
Description: Hi, we've observed a regression in 3.1.25 (it doesn't happen in 3.1.24). Running the following script (Python 3.8.6, Windows 10): import git repo = git.Repo.init('test_git') with open('test_git/f.txt', 'w') as f: f.write('aa') with open(...
Open Graph Description: Hi, we've observed a regression in 3.1.25 (it doesn't happen in 3.1.24). Running the following script (Python 3.8.6, Windows 10): import git repo = git.Repo.init('test_git') with open('test_git/f.t...
X Description: Hi, we've observed a regression in 3.1.25 (it doesn't happen in 3.1.24). Running the following script (Python 3.8.6, Windows 10): import git repo = git.Repo.init('test_git') with op...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/1395
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't add to index twice in a row in 3.1.25 (PermissionError)","articleBody":"Hi, we've observed a regression in 3.1.25 (it doesn't happen in 3.1.24).\r\n\r\nRunning the following script (Python 3.8.6, Windows 10):\r\n\r\n```python\r\nimport git\r\n\r\nrepo = git.Repo.init('test_git')\r\nwith open('test_git/f.txt', 'w') as f:\r\n f.write('aa')\r\nwith open('test_git/g.txt', 'w') as f:\r\n f.write('bb')\r\nrepo.index.add('f.txt')\r\nrepo.index.add('g.txt') # \u003c fails here\r\nrepo.index.commit('initial commit')\r\nrepo.close()\r\n```\r\n\r\nProduces:\r\n```bash\r\n(venv) PS C:\\test\u003e python .\\test_git_close.py\r\n\r\nTraceback (most recent call last):\r\n File \".\\test_git_close.py\", line 9, in \u003cmodule\u003e\r\n repo.index.add('g.txt')\r\n File \"venv\\lib\\site-packages\\git\\index\\base.py\", line 823, in add\r\n self.write(ignore_extension_data=not write_extension_data)\r\n File \"venv\\lib\\site-packages\\git\\index\\base.py\", line 221, in write\r\n lfd.commit()\r\n File \"venv\\lib\\site-packages\\gitdb\\util.py\", line 359, in commit\r\n self._end_writing(successful=True)\r\n File \"venv\\lib\\site-packages\\gitdb\\util.py\", line 384, in _end_writing\r\n remove(self._filepath)\r\n File \"venv\\lib\\site-packages\\gitdb\\util.py\", line 83, in remove\r\n return _retry(os.remove, *args, **kwargs)\r\n File \"venv\\lib\\site-packages\\gitdb\\util.py\", line 77, in _retry\r\n return func(*args, **kwargs)\r\nPermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'test_git\\\\.git\\\\index'\r\n```\r\n\r\nCan be related to #1333 ","author":{"url":"https://github.com/zhiltsov-max","@type":"Person","name":"zhiltsov-max"},"datePublished":"2022-01-10T12:19:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1395/GitPython/issues/1395"}
| 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:eb817f48-d4dd-1356-5281-412205b9cd22 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9EA0:380B24:2013010:2DFB30A:6A58E97E |
| html-safe-nonce | 8b540b821df2f03acfcb836874bda17d53d64e9b03a7eba17d5fc72c2be039cd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RUEwOjM4MEIyNDoyMDEzMDEwOjJERkIzMEE6NkE1OEU5N0UiLCJ2aXNpdG9yX2lkIjoiNjAzMzgwNTE4NzE4OTYzMTM1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | c18ef3cda717b2e385bbc670de11163c6c37b7994f1a2858a21db27eb981851c |
| hovercard-subject-tag | issue:1097832311 |
| 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/GitPython/1395/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2714cc2b38030d8b9e5f52998901770619eff8705ebdde490b493c2cc9f0f1d5/gitpython-developers/GitPython/issues/1395 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2714cc2b38030d8b9e5f52998901770619eff8705ebdde490b493c2cc9f0f1d5/gitpython-developers/GitPython/issues/1395 |
| og:image:alt | Hi, we've observed a regression in 3.1.25 (it doesn't happen in 3.1.24). Running the following script (Python 3.8.6, Windows 10): import git repo = git.Repo.init('test_git') with open('test_git/f.t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zhiltsov-max |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| 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 | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width