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

Fix PosixPath issue with Sphinx 7.2 #964

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scottamain
Copy link

Just need to cast the path to a string.

Fixes #944

Just need to cast the path to a string. 

Fixes breathe-doc#944
@sergiomb2
Copy link

hi, I think you have the same fix but in other way in #956

@sergiomb2
Copy link

I spoke too soon , I use this fix instead of first change on commit of #956

@sergiomb2 sergiomb2 mentioned this pull request Jan 11, 2024
@AA-Turner
Copy link

@jakobandersen sorry for the ping, but I believe you are a maintainer of Breathe -- do you think this PR would be mergeable? It's one of the main things preventing Sphinx 8.0 at the moment.

A

@mgorny
Copy link
Contributor

mgorny commented Jan 27, 2024

Actually, the fix from #956 is more complete. Notably, the tests still fail with this one, so it's not even really "testable".

@AA-Turner
Copy link

Ah, fair enough -- though I don't believe #956 will work on older versions of Sphinx, it should use the Path constructor instead of assuming .parent exists.

A

@mgorny
Copy link
Contributor

mgorny commented Jan 27, 2024

Are you asking me to open a fourth competing pull request? ;-)

@sergiomb2
Copy link

I be clear I use this one, more [1] found in #956

[1]

diff --git a/tests/test_renderer.py b/tests/test_renderer.py
index a858c65d..73a29e4e 100644
--- a/tests/test_renderer.py
+++ b/tests/test_renderer.py
@@ -35,7 +35,11 @@ def app(test_params, app_params, make_app, shared_result):
"""
args, kwargs = app_params
assert "srcdir" in kwargs
-    kwargs["srcdir"].makedirs(exist_ok=True)
+    try:
+        kwargs["srcdir"].mkdir(parents=True, exist_ok=True)
+    except AttributeError:
+        # old version of Sphinx
+        kwargs["srcdir"].makedirs(exist_ok=True)
(kwargs["srcdir"] / "conf.py").write_text("")
app_ = make_app(*args, **kwargs)
yield app_

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 this pull request may close these issues.

AttributeError: 'PosixPath' object has no attribute 'rstrip' in breathe/project.py
4 participants