You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I have observed that when listing files (and clicking the subsequent links), the first character of the top level directory is missing. As a written example:
Wiki/Technical/Cisco.md
with Wiki as the root, when you click "List all pages" you see:
echnical/Cisco
These files are contents searchable- so it's not a wiki wide issue. I've had a look to try and work it out, but couldn't see where in the code the issue was (apologies). When listing all pages, the wiki doesn't throw out any errors. When you click one of the bad links you get the below error in the log:
FileNotFoundError: [Errno 2] No such file or directory: '/home/sqshr/Wiki/echnical/Cisco.md'
I know this error isn't useful for the above issue (hence omitting the Traceback)- but want to show willing :)
Thanks!
The text was updated successfully, but these errors were encountered:
sqshr
changed the title
Directory Listings (Sometimes) Missing First Character
Directory Listings Missing First Character
Sep 27, 2022
Ok, so- I've looked a little more. I think the issue comes from line 123 onwards in wiki.py
folder = root[len(cfg.wiki_directory + "/"):]
If I remove the + "/" from lines 123, 128, and 132- it seems to solve the problem. In a quick look round I couldn't see any ill effects elsewhere- but I'm not confident to state that for a fact!
list_wiki seems overall a bit janky. Instead of operating on strings we could use paths. This would make the code more resilient to edge cases like this one. It would probably make the code more readable too.
As a quick fix:
If you have the wiki directory configured with a trailing slash then drop it.
Hello,
I have observed that when listing files (and clicking the subsequent links), the first character of the top level directory is missing. As a written example:
with Wiki as the root, when you click "List all pages" you see:
These files are contents searchable- so it's not a wiki wide issue. I've had a look to try and work it out, but couldn't see where in the code the issue was (apologies). When listing all pages, the wiki doesn't throw out any errors. When you click one of the bad links you get the below error in the log:
FileNotFoundError: [Errno 2] No such file or directory: '/home/sqshr/Wiki/echnical/Cisco.md'
I know this error isn't useful for the above issue (hence omitting the Traceback)- but want to show willing :)
Thanks!
The text was updated successfully, but these errors were encountered: