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

starting with sphinx 7.2.0, root is a pathlib.Path not a string anymore #1336

Merged
merged 1 commit into from Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion extras/sphinxtogithub/sphinxtogithub.py
Expand Up @@ -97,7 +97,7 @@ class DirectoryHandler:
def __init__(self, name, root, renamer):
self.name = name
self.new_name = name[1:]
self.root = root + os.sep
self.root = str(root)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed this up post-merge to use str(root) + os.sep because the code outside of the constructor does things like path = directory.replace(self.root, "", 1) (Cf. def relative_path()) which currently relies on the trailing / being there so that it replaces all the way through the /.

It doesn't seem to make a difference in cola's usage, but it doesn't hurt to fix this up in case we end up going down that code path in the future so I tweaked this to keep + os.sep at the end.

self.renamer = renamer

def path(self):
Expand Down