Skip to content

Error with sphinx-notfound-page 1.0.3 - 'tuple' object has no attribute 'default' #240

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

Closed
dgarcia360 opened this issue Jul 30, 2024 · 6 comments · Fixed by #241
Closed

Comments

@dgarcia360
Copy link
Contributor

Context

I get the following error in some Sphinx-based projects with the latest release of the extension:

Extension error (notfound.extension):
Handler <function validate_configs at 0x7f69c2a4caf0> for event 'config-inited' threw an exception (exception: 'tuple' object has no attribute 'default')

More details, I'm using:

  • Python 3.12
  • Sphinx 7.2.6
  • notfound_urls_prefix values in conf.py are set to None or ``.

Debugging

The issue might be here: 64ed88f#diff-83bfdb6415a043b1888e7ce5240bd78ea1f236af2f7094fcb5e7702f8672aa32R274

Is trying to access app.config.values.get("notfound_urls_prefix").default, but I'm not sure if the default is being defined.

@humitos
Copy link
Member

humitos commented Jul 30, 2024

We talked about this issue on #236 (review). I thought it was already fixed 🤔

@dgarcia360
Copy link
Contributor Author

Thanks @humitos! I get the build working updating to Sphinx 7.3.0.

Most likely, this is the version where _Opt was included:

I'm happy to submit a PR changing:

if sphinx.version_info >= (7, 2)

To:

if sphinx.version_info >= (7, 3)

@dgarcia360
Copy link
Contributor Author

PR with the fix: #241

@humitos
Copy link
Member

humitos commented Jul 31, 2024

notfound_urls_prefix values in conf.py are set to None or ``.

I'm not yet sure to understand why this wasn't catch by the test we have for this config: https://github.com/rtfd/sphinx-notfound-page/blob/ccdda4977159004aca945bdd1c249b08cf685afe/tests/test_urls.py#L162-L201

We will need to research a little more that so we can write a test case that pass/break depending on the code we are fixing.

humitos added a commit that referenced this issue Jul 31, 2024
I expect some versions to fail due to #240. If that's the case, we can merge #241
here and move forward with it.
humitos added a commit that referenced this issue Jul 31, 2024
* Update Git ignore

* Tests: update test suite and fix some tests

I expect some versions to fail due to #240. If that's the case, we can merge #241
here and move forward with it.
@humitos
Copy link
Member

humitos commented Jul 31, 2024

I released 1.0.4, can you please confirm that it works as expected? 🙏🏼

@dgarcia360
Copy link
Contributor Author

Works fine, thanks!

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