diff --git a/pydoctor/templatewriter/writer.py b/pydoctor/templatewriter/writer.py index dc94885a2..d887a4999 100644 --- a/pydoctor/templatewriter/writer.py +++ b/pydoctor/templatewriter/writer.py @@ -112,8 +112,13 @@ def writeSummaryPages(self, system: model.System) -> None: # When support for Python 3.9 and older is dropped use # pathlib.Path.hardlink_to() instead. - print(Path.cwd()) - os.link(root_module_path.parent / 'index.html', root_module_path) + x = list(root_module_path.parent.glob('*')) + print(f'TTTT\n{root_module_path=} {x=}') + print(f'{root_module_path.exists()=}') + os.link( + src=root_module_path, # original + dst=root_module_path.parent / 'index.html' # the hardlink + ) def _writeDocsFor(self, ob: model.Documentable) -> None: if not ob.isVisible: diff --git a/pydoctor/test/test_commandline.py b/pydoctor/test/test_commandline.py index 7634b2138..c13da2263 100644 --- a/pydoctor/test/test_commandline.py +++ b/pydoctor/test/test_commandline.py @@ -215,6 +215,9 @@ def test_main_symlinked_paths(tmp_path: Path) -> None: link = tmp_path / 'src' link.symlink_to(Path.cwd(), target_is_directory=True) + print(f'{link=} {link.exists()=}') + print(f'{Path.cwd()=} {Path.cwd().exists()=}') + exit_code = driver.main(args=[ '--project-base-dir=.', '--html-viewsource-base=http://example.com',