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

When checking pelican-generated output it segfaults on 'folder' #5

Open
iranzo opened this issue May 24, 2019 · 2 comments · May be fixed by #6
Open

When checking pelican-generated output it segfaults on 'folder' #5

iranzo opened this issue May 24, 2019 · 2 comments · May be fixed by #6

Comments

@iranzo
Copy link

iranzo commented May 24, 2019

 iranzo   source  ~  www  output  link-checker index.html 
Testing: index.html
  [████████████------------------------]   33%  00:00:07  Item 12/36
Traceback (most recent call last):
  File "/home/iranzo/.bin/link-checker", line 10, in <module>
    sys.exit(check())
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/checker.py", line 267, in check
    checker.test_items(items)
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/checker.py", line 201, in test_items
    self.test_file(item)
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/checker.py", line 188, in test_file
    self.test_link(lnk, fname)
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/checker.py", line 169, in test_link
    if not self._test_link(link, external):
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/checker.py", line 150, in _test_link
    ret = self._test_file_fragment(base_link, fragment)
  File "/home/iranzo/.local/venvs/link-checker/lib/python3.7/site-packages/checker.py", line 235, in _test_file_fragment
    with open(fname) as fdata:
IsADirectoryError: [Errno 21] Is a directory: '/home/iranzo/DEVEL/private/www/output/categories'

Cause is because Pelican, when rendered over http will server categories/index.html even if the link is /categories/

Code should contain logic so that when it finds a file, do not attempt to open that file but 'index.htm or index.html' (which are usually the standard ones)

@budziq
Copy link
Owner

budziq commented May 24, 2019

Hi @iranzo, thanks for the report. I currently do not have capacity to tackle this problem in upcoming days but I'd be more than willing to accept a PR!

@iranzo
Copy link
Author

iranzo commented May 24, 2019 via email

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

Successfully merging a pull request may close this issue.

2 participants