Title: [Windows] Create_submodule fails due to use of hidden files · Issue #516 · gitpython-developers/GitPython · GitHub
Open Graph Title: [Windows] Create_submodule fails due to use of hidden files · Issue #516 · gitpython-developers/GitPython
X Title: [Windows] Create_submodule fails due to use of hidden files · Issue #516 · gitpython-developers/GitPython
Description: On Windows, the .git files are given the hidden attribute. If a file is marked as hidden, it cannot be written to using the standard Python open(..., 'w') command. This is because the underlying win32 api errors unless the attributes of ...
Open Graph Description: On Windows, the .git files are given the hidden attribute. If a file is marked as hidden, it cannot be written to using the standard Python open(..., 'w') command. This is because the underlying wi...
X Description: On Windows, the .git files are given the hidden attribute. If a file is marked as hidden, it cannot be written to using the standard Python open(..., 'w') command. This is because the under...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/516
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Windows] Create_submodule fails due to use of hidden files","articleBody":"On Windows, the .git files are given the hidden attribute. If a file is marked as hidden, it cannot be written to using the standard Python open(..., 'w') command. This is because the underlying win32 api errors unless the attributes of the open command match the attributes of the file, and this is not exposed in the Python API\n\nFor example, consider the following snippet:\n\n```\nimport git\nr = git.Repo('test')\nr.create_submodule(name='testing', path='testing', url='https://github.com/matthewwardrop/python-parampy')\n```\n\nOn Unix, this works fine. In Windows, however, it will crash with the following stack trace:\n\n```\nTraceback (most recent call last):\n ...\n File \"c:\\program files\\python35\\lib\\site-packages\\git\\repo\\base.py\", line 306, in create_submodule\n return Submodule.add(self, *args, **kwargs)\n File \"c:\\program files\\python35\\lib\\site-packages\\git\\objects\\submodule\\base.py\", line 389, in add\n mrepo = cls._clone_repo(repo, url, path, name, **kwargs)\n File \"c:\\program files\\python35\\lib\\site-packages\\git\\objects\\submodule\\base.py\", line 253, in _clone_repo\n cls._write_git_file_and_module_config(module_checkout_path, module_abspath)\n File \"c:\\program files\\python35\\lib\\site-packages\\git\\objects\\submodule\\base.py\", line 292, in _write_git_file_and_mod\nule_config\n fp = open(git_file, 'wb')\nPermissionError: [Errno 13] Permission denied: 'C:\\\\Users\\\\matthewwardrop\\\\test\\\\testing\\\\.git'\n```\n\nThere's probably a workaround using the raw git commands, but it would be nice to have this cleaned up.\n","author":{"url":"https://github.com/matthewwardrop","@type":"Person","name":"matthewwardrop"},"datePublished":"2016-09-22T04:02:37.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/516/GitPython/issues/516"}
| 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:e6951a5f-f562-38f5-52ad-838fd5e245b4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EAF6:203CDE:3D8579B:3E4AEF0:696867DA |
| html-safe-nonce | d31914e60599c547e366ea7287d9807a488dead24a983a9eb7cc8e6e76256e32 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUY2OjIwM0NERTozRDg1NzlCOjNFNEFFRjA6Njk2ODY3REEiLCJ2aXNpdG9yX2lkIjoiNTAyMDM2OTIzNTIwMDIwNjgxMCIsInJlZ2lvbl9lZGdlIjoic2VhIiwicmVnaW9uX3JlbmRlciI6InNlYSJ9 |
| visitor-hmac | 853b0062aa6e03842de29c9573c45112bb1bf98e4194b7522da96e9e0141bacb |
| hovercard-subject-tag | issue:178517065 |
| 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/516/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2d09a6e81db6f01be779ced613f6e3d5b4b91d082c5dc81b88b1774f654fdfdd/gitpython-developers/GitPython/issues/516 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2d09a6e81db6f01be779ced613f6e3d5b4b91d082c5dc81b88b1774f654fdfdd/gitpython-developers/GitPython/issues/516 |
| og:image:alt | On Windows, the .git files are given the hidden attribute. If a file is marked as hidden, it cannot be written to using the standard Python open(..., 'w') command. This is because the underlying wi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | matthewwardrop |
| hostname | github.com |
| expected-hostname | github.com |
| None | 50f46dc2d6192249fd8ebf20e76c800f4f2596d4a5f3ab63dd63a754df154f54 |
| 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 | fef287f17234b4529a4b112a3d47fe8551e32ddd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width