Skip to content

[pyxdg] Allow None return from load_first_config - #16705

Merged
srittau merged 1 commit into
python:mainfrom
mmporong:pyxdg-load-first-config-none
Nov 5, 2026
Merged

srittau merged 1 commit into
python:mainfrom
mmporong:pyxdg-load-first-config-none

Conversation

@mmporong

@mmporong mmporong commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

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. 🤖🎉

@srittau
srittau merged commit 64c9da7 into python:main Nov 5, 2026
74 checks passed
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.

2 participants