Title: Improve wave module error messages to include the offending value · Issue #149306 · python/cpython · GitHub
Open Graph Title: Improve wave module error messages to include the offending value · Issue #149306 · python/cpython
X Title: Improve wave module error messages to include the offending value · Issue #149306 · python/cpython
Description: Summary The wave module currently raises errors without the offending value: wave.Error: bad # of channels wave.Error: bad sample width wave.Error: bad frame rate When values come from variables, configuration, or parsed data, the traceb...
Open Graph Description: Summary The wave module currently raises errors without the offending value: wave.Error: bad # of channels wave.Error: bad sample width wave.Error: bad frame rate When values come from variables, c...
X Description: Summary The wave module currently raises errors without the offending value: wave.Error: bad # of channels wave.Error: bad sample width wave.Error: bad frame rate When values come from variables, c...
Opengraph URL: https://github.com/python/cpython/issues/149306
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve wave module error messages to include the offending value","articleBody":"## Summary\n\nThe `wave` module currently raises errors without the offending value:\n\n```\nwave.Error: bad # of channels\nwave.Error: bad sample width\nwave.Error: bad frame rate\n```\n\nWhen values come from variables, configuration, or parsed data, the\ntraceback shows the call site but not the actual offending value. For\n`Wave_read`, the values are parsed from the WAV file header and never\nappear in the traceback at all.\n\n## Reproduction\n\n```python\nimport wave, io\nwave.open(io.BytesIO(), 'wb').setframerate(-1)\n# wave.Error: bad frame rate\n```\n\nAfter this change:\n\n```\nwave.Error: bad frame rate: -1\n```\n\nI have a patch ready and will open a PR shortly.\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-149307\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/htjworld","@type":"Person","name":"htjworld"},"datePublished":"2026-05-03T02:07:28Z","url":"https://github.com/python/cpython/issues/149306"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:870472d3-59fa-3387-6667-26f4884da2f0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B75E:38E1F8:39A221:4CCFF4:6AECC9C2 |
| html-safe-nonce | 1b25816595ba8e09e05f2d83f122b1eae698e50b19015b2dfbc05bb1da4442d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzVFOjM4RTFGODozOUEyMjE6NENDRkY0OjZBRUNDOUMyIiwidmlzaXRvcl9pZCI6IjU1NzY5NTg2MzQxMzkzNzE5NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1c15a7ffdb81f6e0f77ad6d3d738d140f474d62412a730000bb2821c29497070 |
| hovercard-subject-tag | issue:4370617723 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/149306/issue_layout |
| twitter:image | https://opengraph.githubassets.com/196d0c8de75ff89867b8f9b3cd2a9c32bbadd7fcca49e915918cdbb8eec8552e/python/cpython/issues/149306 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/196d0c8de75ff89867b8f9b3cd2a9c32bbadd7fcca49e915918cdbb8eec8552e/python/cpython/issues/149306 |
| og:image:alt | Summary The wave module currently raises errors without the offending value: wave.Error: bad # of channels wave.Error: bad sample width wave.Error: bad frame rate When values come from variables, c... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | htjworld |
| hostname | github.com |
| expected-hostname | github.com |
| None | dc0b519c5798dc1150b88dc4c06a8b9634d0069218dc04e469970e76aad74016 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | db139f0bf57b59bf9a8c4abb0849924d6c6ca559 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width