Skip to content
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

Long paths on Windows lead to errors due to shutil limitations #156

Open
Rubyfi opened this issue Feb 4, 2025 · 1 comment
Open

Long paths on Windows lead to errors due to shutil limitations #156

Rubyfi opened this issue Feb 4, 2025 · 1 comment

Comments

@Rubyfi
Copy link
Collaborator

Rubyfi commented Feb 4, 2025

Describe the bug
The bug occurs when shutil is trying to delete files with really long paths whilte the EnableLongPaths registry entry is not set.

  File "...\Python310\Lib\site-packages\doxysphinx\utils\files.py", line 143, in copy_if_different
    shutil.copy(source_file, target_file)
  File "shutil.py", line 417, in copy
  File "shutil.py", line 256, in copyfile
FileNotFoundError: [Errno 2] No such file or directory: 'super\duper\long\path\filename_icgraph.map'

To Reproduce
Steps to reproduce the behavior:

  • Create a really long base path for your project (>260 characters)
  • Run doxygen
  • Run doxysphinx

Expected behavior
The file shuld be handled properly.

Desktop (please complete the following information):

  • OS: Windows 10

Additional context
This can be solved enabling long file paths programmatically: https://burgaud.com/path-too-long/
I was able to fix the issue transforming the paths if running doxysphinx on Windows:

files.py:135 ff

    result: List[Path] = []
    for file in files_to_copy:
        source_file = file
        target_file = target_dir / source_file.relative_to(source_dir)
        target_file.parent.mkdir(parents=True, exist_ok=True)
        if os.name == 'nt':
            source_file = r"\\?\%s" % source_file
            target_file = r"\\?\%s" % target_file

        shutil.copy(source_file, target_file)
        result.append(target_file)

    return result
@Rubyfi
Copy link
Collaborator Author

Rubyfi commented Feb 4, 2025

I'll open a PR to supply this fix soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant