Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[Windows] Create_submodule fails due to use of hidden files #516
Comments
Thanks for letting me know. If you can come up with a solution that works for you, I would be very happy about a PR. Windows is not a platform I can test on, and am therefore dependent on contributions in that realm. |
@matthewwardrop this must have been fixed by #519 (b8b025f) where the file gets deleted before overwritting it. Anyway, please check if it is ok, before closing the issue. |
I am closing this issue as it had no interaction for more than 3 months. Please feel free to comment in case you need it to be reopened. |
@Byron @ankostis Thanks for fixing this. Sorry for the huge delay. I don't often use Windows, so I guess I never got around to checking this. Given that things seem to work for you in appveyor, and people have not been reporting bugs against my project (the knowledge repo), it looks like these issues have been fixed. I really appreciate it! |
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
For example, consider the following snippet:
On Unix, this works fine. In Windows, however, it will crash with the following stack trace:
There's probably a workaround using the raw git commands, but it would be nice to have this cleaned up.