Skip to content

[pyxdg] Allow None return from load_first_config - #16705

Open
mmporong wants to merge 1 commit into
python:mainfrom
mmporong:pyxdg-load-first-config-none
Open

mmporong wants to merge 1 commit into
python:mainfrom
mmporong:pyxdg-load-first-config-none

Conversation

@mmporong

@mmporong mmporong commented Nov 5, 2026

Copy link
Copy Markdown

xdg.BaseDirectory.load_first_config returns None when no configuration directory matches (docstring and implementation), but the stub says it always returns str, so load_first_config("app").upper() type-checks and then fails at runtime with AttributeError.

This changes the return type to str | None.

Agent: Claude Code (claude-opus-5-5)

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
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.

1 participant