René's URL Explorer Experiment


Title: Python 3.15: `AttributeError` from `argparse` on every `tmuxp` command · Issue #1094 · tmux-python/tmuxp · GitHub

Open Graph Title: Python 3.15: `AttributeError` from `argparse` on every `tmuxp` command · Issue #1094 · tmux-python/tmuxp

X Title: Python 3.15: `AttributeError` from `argparse` on every `tmuxp` command · Issue #1094 · tmux-python/tmuxp

Description: Step 1: Provide a summary of your problem On Python 3.15.0, every tmuxp invocation, including tmuxp --version, fails with AttributeError: 'NoneType' object has no attribute 'reset' while the argument parser is being built. TmuxpHelpForma...

Open Graph Description: Step 1: Provide a summary of your problem On Python 3.15.0, every tmuxp invocation, including tmuxp --version, fails with AttributeError: 'NoneType' object has no attribute 'reset' while the argume...

X Description: Step 1: Provide a summary of your problem On Python 3.15.0, every tmuxp invocation, including tmuxp --version, fails with AttributeError: 'NoneType' object has no attribute 'reset' ...

Opengraph URL: https://github.com/tmux-python/tmuxp/issues/1094

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Python 3.15: `AttributeError` from `argparse` on every `tmuxp` command","articleBody":"### Step 1: Provide a summary of your problem\n\nOn Python 3.15.0, every `tmuxp` invocation, including `tmuxp --version`, fails with `AttributeError: 'NoneType' object has no attribute 'reset'` while the argument parser is being built. `TmuxpHelpFormatter` declares a class attribute `_theme` that shadows the `_theme` property of `argparse.HelpFormatter`, which 3.15 added to support coloured help. Much of the test suite fails for the same reason; it passes on Python 3.14.\n\n### Step 2: Provide tmuxp details\n\n`tmuxp debug-info` crashes on 3.15 with the same error, so these versions come from the checkout and `uv.lock`:\n\n\u003cdetails>\n\u003csummary>Environment\u003c/summary>\n\n- tmuxp 1.74.0 at `ddd6cce`, libtmux 0.61.0 (from `uv.lock`)\n- Python 3.15.0\n- uv 0.13.1\n- Linux x86_64\n\n\u003c/details>\n\n### Step 3: Describe the problem:\n\n#### Steps to reproduce:\n\n1. Check out the repository and install the project with all extras and dev dependencies on Python 3.15.\n\n```console\n$ uv sync --python 3.15 --all-extras --dev\n```\n\n2. Run any command.\n\n```console\n$ uv run tmuxp --version\n```\n\n3. Or run a single test.\n\n```console\n$ uv run py.test tests/cli/test_cli.py -k help_long_flag\n```\n\n#### Observed Results:\n\n```\nAttributeError: 'NoneType' object has no attribute 'reset'\n```\n\nWithout colour (no TTY, or `NO_COLOR` set), `create_themed_formatter()` binds `theme = None`, so `argparse` reads `None` for `self._theme` in `_apply_text_markup`. With colour forced (`FORCE_COLOR=1`), the bound `HelpTheme` is read instead and fails with `AttributeError: 'HelpTheme' object has no attribute 'prog_extra'`, because `argparse` expects its own theme object.\n\n\u003cdetails>\n\u003csummary>Traceback from \u003ccode>uv run tmuxp --version\u003c/code>\u003c/summary>\n\n```\nTraceback (most recent call last):\n  File \"\u003crepo>/.venv/bin/tmuxp\", line 10, in \u003cmodule>\n    sys.exit(cli.cli())\n             ~~~~~~~^^\n  File \"\u003crepo>/src/tmuxp/cli/__init__.py\", line 297, in cli\n    parser = create_parser()\n  File \"\u003crepo>/src/tmuxp/cli/__init__.py\", line 169, in create_parser\n    parser = argparse.ArgumentParser(\n        prog=\"tmuxp\",\n        description=CLI_DESCRIPTION,\n        formatter_class=formatter_class,\n    )\n  File \"\u003cstdlib>/argparse.py\", line 2058, in __init__\n    self.add_argument(\n  File \"\u003cstdlib>/argparse.py\", line 1695, in add_argument\n    self._check_help(action)\n  File \"\u003cstdlib>/argparse.py\", line 1887, in _check_help\n    formatter._expand_help(action)\n  File \"\u003cstdlib>/argparse.py\", line 716, in _expand_help\n    return self._apply_text_markup(help_string)\n  File \"\u003cstdlib>/argparse.py\", line 568, in _apply_text_markup\n    if not t.reset:\n           ^^^^^^^\nAttributeError: 'NoneType' object has no attribute 'reset'\n```\n\n\u003c/details>\n\n#### Expected Results:\n\n`tmuxp --version` prints the version, and the test suite passes as it does on Python 3.14.\n\n#### Relevant Code:\n\nPython 3.15 added backtick markup to `argparse` help text ([What's New in Python 3.15](https://docs.python.org/3.15/whatsnew/3.15.html), [python/cpython#142389](https://github.com/python/cpython/issues/142389), [python/cpython#149375](https://github.com/python/cpython/issues/149375)). `argparse.HelpFormatter` now computes its colours through a read-only `_theme` property and reads it in `_apply_text_markup`. The excerpt is from [`Lib/argparse.py` at `v3.15.0`](https://github.com/python/cpython/blob/d220409a13b77de7a6c30abe16ea90db01528edc/Lib/argparse.py#L227-L232) and [lines 559-570](https://github.com/python/cpython/blob/d220409a13b77de7a6c30abe16ea90db01528edc/Lib/argparse.py#L559-L570):\n\n```python\n    @property\n    def _theme(self):\n        if self._cached_theme is None:\n            self._get_theme_and_decolor()\n        return self._cached_theme\n\n    def _apply_text_markup(self, text):\n        ...\n        t = self._theme\n        if not t.reset:\n            return text\n```\n\ntmuxp's formatter already used `_theme` for its own `HelpTheme`, so it now collides with the stdlib name: the class attribute at [`src/tmuxp/cli/_formatter.py` lines 85-86](https://github.com/tmux-python/tmuxp/blob/ddd6cce/src/tmuxp/cli/_formatter.py#L85-L86) replaces the property, and the instance assignment in [lines 391-396](https://github.com/tmux-python/tmuxp/blob/ddd6cce/src/tmuxp/cli/_formatter.py#L391-L396) sets the value `argparse` then reads. The parser is built at [`src/tmuxp/cli/__init__.py` lines 163-173](https://github.com/tmux-python/tmuxp/blob/ddd6cce/src/tmuxp/cli/__init__.py#L163-L173), and `ArgumentParser.__init__` adds `-h/--help`, whose help text goes through `_apply_text_markup` immediately.\n\n### Proposal\n\nStore tmuxp's theme under a name `argparse` does not use, for example `_help_theme`, in `TmuxpHelpFormatter._fill_text`, `_colorize_example_line`, and `create_themed_formatter`, and leave `_theme` to the standard library.\n\n### References\n\n- [What's New in Python 3.15](https://docs.python.org/3.15/whatsnew/3.15.html)\n- [`argparse` documentation for Python 3.15](https://docs.python.org/3.15/library/argparse.html)\n- [python/cpython#142389](https://github.com/python/cpython/issues/142389): backtick colourisation in `argparse` help text\n- [python/cpython#149375](https://github.com/python/cpython/issues/149375): backtick markup in argument help\n","author":{"url":"https://github.com/tony","@type":"Person","name":"tony"},"datePublished":"2026-10-17T16:28:49Z","url":"https://github.com/tmux-python/tmuxp/issues/1094"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ebf86469-1e2f-8d00-3e4d-1511cfbc6081
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA90C:D4E59:99CC19:C1E3B2:6B021270
html-safe-nonce981d6e8622ccd47775420c40b08a9b74b9fb336a520ee9abbf3e4bba3af651b5
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTBDOkQ0RTU5Ojk5Q0MxOTpDMUUzQjI6NkIwMjEyNzAiLCJ2aXNpdG9yX2lkIjoiNTYwOTczMjMzMTI4MDY2NzI0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac51727820a5ea927ce6fe87041b57dcfe99ff1d0e348c71da9db74150a124b6c0
hovercard-subject-tagissue:5900577393
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/tmux-python/tmuxp/1094/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7352c83558c071939c7496f5b0e79236333c57e320c473a9f5b527c164494cf8/tmux-python/tmuxp/issues/1094
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7352c83558c071939c7496f5b0e79236333c57e320c473a9f5b527c164494cf8/tmux-python/tmuxp/issues/1094
og:image:altStep 1: Provide a summary of your problem On Python 3.15.0, every tmuxp invocation, including tmuxp --version, fails with AttributeError: 'NoneType' object has no attribute 'reset' while the argume...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametony
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/tmux-python/tmuxp git https://github.com/tmux-python/tmuxp.git
octolytics-dimension-user_id37234308
octolytics-dimension-user_logintmux-python
octolytics-dimension-repository_id12398170
octolytics-dimension-repository_nwotmux-python/tmuxp
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id12398170
octolytics-dimension-repository_network_root_nwotmux-python/tmuxp
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/tmux-python/tmuxp/issues/1094#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftmux-python%2Ftmuxp%2Fissues%2F1094
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftmux-python%2Ftmuxp%2Fissues%2F1094
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=tmux-python%2Ftmuxp
Reloadhttps://github.com/tmux-python/tmuxp/issues/1094
Reloadhttps://github.com/tmux-python/tmuxp/issues/1094
Reloadhttps://github.com/tmux-python/tmuxp/issues/1094
tmux-pythonhttps://github.com/tmux-python
tmuxphttps://github.com/tmux-python/tmuxp
Codehttps://github.com/tmux-python/tmuxp
Issues113 (113)https://github.com/tmux-python/tmuxp/issues
Pull requests29 (29)https://github.com/tmux-python/tmuxp/pulls
Discussionshttps://github.com/tmux-python/tmuxp/discussions
Actionshttps://github.com/tmux-python/tmuxp/actions
Security and qualityhttps://github.com/tmux-python/tmuxp/security
Insightshttps://github.com/tmux-python/tmuxp/insights
https://github.com/tmux-python/tmuxp
New issuehttps://github.com/login?return_to=https://github.com/tmux-python/tmuxp/issues/1094
New issuehttps://github.com/login?return_to=https://github.com/tmux-python/tmuxp/issues/1094
#1095https://github.com/tmux-python/tmuxp/pull/1095
Python 3.15: AttributeError from argparse on every tmuxp commandhttps://github.com/tmux-python/tmuxp/issues/1094#top
#1095https://github.com/tmux-python/tmuxp/pull/1095
https://github.com/tony
tonyhttps://github.com/tony
on Oct 17, 2026https://github.com/tmux-python/tmuxp/issues/1094#issue-5900577393
What's New in Python 3.15https://docs.python.org/3.15/whatsnew/3.15.html
python/cpython#142389https://github.com/python/cpython/issues/142389
python/cpython#149375https://github.com/python/cpython/issues/149375
Lib/argparse.py at v3.15.0https://github.com/python/cpython/blob/d220409a13b77de7a6c30abe16ea90db01528edc/Lib/argparse.py#L227-L232
lines 559-570https://github.com/python/cpython/blob/d220409a13b77de7a6c30abe16ea90db01528edc/Lib/argparse.py#L559-L570
src/tmuxp/cli/_formatter.py lines 85-86https://github.com/tmux-python/tmuxp/blob/ddd6cce/src/tmuxp/cli/_formatter.py#L85-L86
lines 391-396https://github.com/tmux-python/tmuxp/blob/ddd6cce/src/tmuxp/cli/_formatter.py#L391-L396
src/tmuxp/cli/__init__.py lines 163-173https://github.com/tmux-python/tmuxp/blob/ddd6cce/src/tmuxp/cli/__init__.py#L163-L173
What's New in Python 3.15https://docs.python.org/3.15/whatsnew/3.15.html
argparse documentation for Python 3.15https://docs.python.org/3.15/library/argparse.html
python/cpython#142389https://github.com/python/cpython/issues/142389
python/cpython#149375https://github.com/python/cpython/issues/149375
tonyhttps://github.com/tony
on Oct 24, 2026https://github.com/tmux-python/tmuxp/issues/1094#event-34103603991
cli(fix[formatter]): Leave _theme to argparsehttps://github.com/tmux-python/tmuxp/commit/851b439aaca7816a3d426dcca27dbe163f280cbc
851b439https://github.com/tmux-python/tmuxp/commit/851b439aaca7816a3d426dcca27dbe163f280cbc
cli(fix[formatter]): Leave _theme to argparsehttps://github.com/tmux-python/tmuxp/commit/ce16ea4295c570afeb030ad970d538fcb81486f1
ce16ea4https://github.com/tmux-python/tmuxp/commit/ce16ea4295c570afeb030ad970d538fcb81486f1
cli(fix[formatter]): Leave _theme to argparsehttps://github.com/tmux-python/tmuxp/commit/db727ed930461be9767e4a4254717e557db7d3d5
db727edhttps://github.com/tmux-python/tmuxp/commit/db727ed930461be9767e4a4254717e557db7d3d5
tonyhttps://github.com/tony
completedhttps://github.com/tmux-python/tmuxp/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#1095https://github.com/tmux-python/tmuxp/pull/1095
on Oct 24, 2026https://github.com/tmux-python/tmuxp/issues/1094#event-34121076175
Sign up for freehttps://github.com/signup?return_to=https://github.com/tmux-python/tmuxp/issues/1094
Sign in to commenthttps://github.com/login?return_to=https://github.com/tmux-python/tmuxp/issues/1094
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.