René's URL Explorer Experiment


Title: Regression of #305 in v0.10.0: disable_numparse=True is ignored when maxcolwidths is set · Issue #428 · astanin/python-tabulate · GitHub

Open Graph Title: Regression of #305 in v0.10.0: disable_numparse=True is ignored when maxcolwidths is set · Issue #428 · astanin/python-tabulate

X Title: Regression of #305 in v0.10.0: disable_numparse=True is ignored when maxcolwidths is set · Issue #428 · astanin/python-tabulate

Description: Disclaimer: The following was generated with AI. Bug was originally discovered on BBOT via our CI dependabot: blacklanternsecurity/bbot#3045 This is a regression. The same bug was previously reported as #305 ("Can not tabulate row with a...

Open Graph Description: Disclaimer: The following was generated with AI. Bug was originally discovered on BBOT via our CI dependabot: blacklanternsecurity/bbot#3045 This is a regression. The same bug was previously report...

X Description: Disclaimer: The following was generated with AI. Bug was originally discovered on BBOT via our CI dependabot: blacklanternsecurity/bbot#3045 This is a regression. The same bug was previously report...

Opengraph URL: https://github.com/astanin/python-tabulate/issues/428

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Regression of #305 in v0.10.0: disable_numparse=True is ignored when maxcolwidths is set","articleBody":"*Disclaimer: The following was generated with AI. Bug was originally discovered on BBOT via our CI dependabot: https://github.com/blacklanternsecurity/bbot/pull/3045*\n\nThis is a regression. The same bug was previously reported as #305 (\"Can not tabulate row with a field that looks like a Python Bool using maxcolwidths\"), fixed by PR #362 (\"Fix handling 'True'/'False' bool str and None\"), merged on 2025-07-23. The buggy code came back in a later merge and is now present on `master` and in the v0.10.0 release.\n\n## Symptom\n\nWhen `disable_numparse=True` is combined with `maxcolwidths`, cells that look number-ish but cannot actually be parsed (e.g. `'80,443'`, a comma-separated port list) crash with `ValueError: invalid literal for int() with base 10`. The same input works fine without `maxcolwidths` — `disable_numparse=True` is honored on the non-wrap code path, but ignored on the wrap path.\n\n## Repro (v0.10.0, also present on `master`)\n\n```python\nfrom tabulate import tabulate\ntabulate(\n    [['ports', 'str', 'comma-separated port list', '80,443']],\n    ['name', 'type', 'desc', 'default'],\n    tablefmt='grid',\n    disable_numparse=True,\n    maxcolwidths=40,\n)\n```\n\nTraceback:\n\n```\nFile \".../tabulate/__init__.py\", line 1705, in _wrap_text_to_colwidths\n    else str(_type(cell, numparse)(cell))\nValueError: invalid literal for int() with base 10: '80,443'\n```\n\nOmit `maxcolwidths` and `disable_numparse=True` is honored and the call succeeds.\n\n## Root cause\n\nIn `_wrap_text_to_colwidths`, the per-cell `numparse` flag is correctly computed (the traceback's locals show `numparses = [False, False, False, False]` for this call), and it is correctly honored in the first branch:\n\n```python\nif _isnumber(cell) and numparse:\n    new_row.append(cell)\n    continue\n```\n\nBut a few lines later it is passed **positionally** into `_type`:\n\n```python\nelse str(_type(cell, numparse)(cell))\n```\n\n`_type`'s signature is:\n\n```python\ndef _type(string, has_invisible=True, numparse=True):\n```\n\nso the `False` lands in the `has_invisible` slot and `numparse` stays at its default `True`. Result: `_type('80,443')` returns `int`, then `int('80,443')` raises.\n\nThis is what PR #362's commit `d29909b` already called out:\n\n> \"calling `_type` is incorrect here; the subsequent lines need a `str`. … This regressed in e8e3091…\"\n\n## How it came back\n\n1. `886e2ed` (Sep 2022) — introduced the buggy `_type(cell, numparse)(cell)` line.\n2. `d29909b` / PR #362 (Mar 2025) — replaced the whole conditional with `casted_cell = str(cell)`. Issue #305 closed as completed on 2025-07-23.\n3. A subsequent merge brought the old buggy version back (now wrapped in `str(...)` and reformatted by ruff/black, but functionally the same `_type(cell, numparse)` call). Master and v0.10.0 both ship the regressed code.\n\n## Impact\n\nAnyone passing `disable_numparse=True` together with `maxcolwidths` and a string cell that doesn't satisfy `_isnumber` but is recognized as numeric by `_type`'s default `numparse=True` (e.g. `'80,443'`, `'True'`, `'False'`) will crash. We hit this in BBOT's CLI, which renders module-options tables; `'80,443'` is a default value for several modules.\n\n## Environment\n\n- tabulate 0.10.0 (also reproduced building from current `master`)\n- Python 3.10 – 3.14 (reproduced on all)\n","author":{"url":"https://github.com/liquidsec","@type":"Person","name":"liquidsec"},"datePublished":"2026-05-12T15:40:33Z","url":"https://github.com/astanin/python-tabulate/issues/428"}

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:bc5aef0c-331d-2409-355d-2a186a3390c1
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD2E0:209BD:7931C5:A8E5A1:6AFF3840
html-safe-noncee6f8460822782ac819c9a692ad26c6a1d52598c1ec179f12e3d4bdbcef52468a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkUwOjIwOUJEOjc5MzFDNTpBOEU1QTE6NkFGRjM4NDAiLCJ2aXNpdG9yX2lkIjoiMzQyMzA3NjQxNjg3NzQ0MzEzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac60d2693ceeb4841918df1f39e4f91b8719b63c3110701963913de5eadc2e3524
hovercard-subject-tagissue:4430519578
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/astanin/python-tabulate/428/issue_layout
twitter:imagehttps://opengraph.githubassets.com/018dadde8189e87aa34b14118b2028515aa6a839fef049d4f50ae5036732ba3e/astanin/python-tabulate/issues/428
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/018dadde8189e87aa34b14118b2028515aa6a839fef049d4f50ae5036732ba3e/astanin/python-tabulate/issues/428
og:image:altDisclaimer: The following was generated with AI. Bug was originally discovered on BBOT via our CI dependabot: blacklanternsecurity/bbot#3045 This is a regression. The same bug was previously report...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameliquidsec
hostnamegithub.com
expected-hostnamegithub.com
Nonec62a4cffe270f7bba529ed9ad80c801130bd3c78e2633b6731e04c3d4c94463b
turbo-cache-controlno-preview
go-importgithub.com/astanin/python-tabulate git https://github.com/astanin/python-tabulate.git
octolytics-dimension-user_id71802
octolytics-dimension-user_loginastanin
octolytics-dimension-repository_id205875548
octolytics-dimension-repository_nwoastanin/python-tabulate
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id205875548
octolytics-dimension-repository_network_root_nwoastanin/python-tabulate
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
release1a7765b21f802bf37d4363105328933cfb777dff
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/astanin/python-tabulate/issues/428#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fastanin%2Fpython-tabulate%2Fissues%2F428
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%2Fastanin%2Fpython-tabulate%2Fissues%2F428
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=astanin%2Fpython-tabulate
Reloadhttps://github.com/astanin/python-tabulate/issues/428
Reloadhttps://github.com/astanin/python-tabulate/issues/428
Reloadhttps://github.com/astanin/python-tabulate/issues/428
astaninhttps://github.com/astanin
python-tabulatehttps://github.com/astanin/python-tabulate
Codehttps://github.com/astanin/python-tabulate
Issues75 (75)https://github.com/astanin/python-tabulate/issues
Pull requests63 (63)https://github.com/astanin/python-tabulate/pulls
Actionshttps://github.com/astanin/python-tabulate/actions
Security and qualityhttps://github.com/astanin/python-tabulate/security
Insightshttps://github.com/astanin/python-tabulate/pulse
https://github.com/astanin/python-tabulate
New issuehttps://github.com/login?return_to=https://github.com/astanin/python-tabulate/issues/428
New issuehttps://github.com/login?return_to=https://github.com/astanin/python-tabulate/issues/428
#473https://github.com/astanin/python-tabulate/pull/473
#431https://github.com/astanin/python-tabulate/pull/431
Regression of #305 in v0.10.0: disable_numparse=True is ignored when maxcolwidths is sethttps://github.com/astanin/python-tabulate/issues/428#top
#473https://github.com/astanin/python-tabulate/pull/473
#431https://github.com/astanin/python-tabulate/pull/431
https://github.com/liquidsec
liquidsechttps://github.com/liquidsec
on May 12, 2026https://github.com/astanin/python-tabulate/issues/428#issue-4430519578
blacklanternsecurity/bbot#3045https://github.com/blacklanternsecurity/bbot/pull/3045
#305https://github.com/astanin/python-tabulate/issues/305
#362https://github.com/astanin/python-tabulate/pull/362
#362https://github.com/astanin/python-tabulate/pull/362
e8e3091https://github.com/astanin/python-tabulate/commit/e8e3091d46966f462735f227d5ef4effdfaa0582
Fix handling "True"/"False" bool str and None #362https://github.com/astanin/python-tabulate/pull/362
Can not tabulate row with a field that looks like a Python Bool using maxcolwidths #305https://github.com/astanin/python-tabulate/issues/305
Sign up for freehttps://github.com/signup?return_to=https://github.com/astanin/python-tabulate/issues/428
Sign in to commenthttps://github.com/login?return_to=https://github.com/astanin/python-tabulate/issues/428
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.