-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pydoctor crashes on Windows when trying to symlink to a nonexistent file: 'index.html' #808
Comments
Thanks a lot the report. It has also been reported in #720. |
So weird the tests did not caught that though… |
I think this may be a Windows-only bug and perhaps that is why tests did not catch it. Windows interprets creating a symlink as creating a shortcut, and cannot create a shortcut to a file that does not exist. |
All the tests are supposed to be run on windows as well. pydoctor/.github/workflows/unit.yaml Line 26 in 0743773
|
I believe this issue can be closed. See #809 (comment) |
Trying to generate documentation of a single package using pydoctor results in
[WinError 5] Access is denied: 'index.hmtl' -> 'package_name.html'
I'm running Python 3 on Windows 10 using Anaconda. I'm calling pydoctor from the command line using a batch script.
The traceback points to pydoctor\templatewriter\writer.py, line 111 in writeSummaryPages
root_module_path.symlink_to('index.html')
The issue is that 'index.html' does not yet exist, so the symlink fails. 'index.html' is written when TemplateWriter._writeDocsFor is called by TemplateWriter.writeIndividualFiles. In driver.py the make function calls writeSummaryPages before calling writeIndividualFiles.
My quick "monkey patch" solution was to add a return after line 109 in writeSummaryPages in templatewriter\writer.py. 'packagename.html' is still not created, but all of the other html files are, including 'index.html'.
The creation of the symlink needs to be moved to after 'index.html' is created. My personal approach would be to add a new function to writer.py, perhaps called writeIndexLink, and move the code from lines 101-111 in writer.py to the new function. Then that new function would be called right after writeIndividualFiles is called on line 131 in driver.py.
The text was updated successfully, but these errors were encountered: