TLS failures are masked by AttributeError when API exception body is None
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 25/100
Research direction
Start with gen/templates/api_client.mustache and the generated api_client.py exception-body decoding described in the issue. Review the linked signed fix and its tests to understand the reported behavior; verify that None and string bodies are handled while byte bodies retain UTF-8 decoding. The issue reports five public AssetsApi regression and control tests passing, with broader suite limitations noted.
Written by the indexing model from the issue text.
Description
Problem
A TLS transport error through AssetsApi.list_assets() is replaced by AttributeError: 'NoneType' object has no attribute 'decode', obscuring the intended SDK ApiException and its diagnostic reason. The REST layer constructs ApiException(status=0, reason=...) without a response body; the API client unconditionally decodes e.body.
Offline reproduction
from unittest.mock import patch
import urllib3
from mux_python import ApiClient, AssetsApi
with ApiClient() as client:
with patch.object(client.rest_client.pool_manager, 'request',
side_effect=urllib3.exceptions.SSLError('certificate failed')):
AssetsApi(client).list_assets()
Expected: ApiException with status 0 and the SSL diagnostic. Actual: AttributeError at api_client.py's exception-body decoding. Already-decoded string bodies also fail there; byte bodies should retain UTF-8 decoding.
Following the README's issue-only workflow, I published a tested fork rather than opening a PR: signed fix and tests. It updates both gen/templates/api_client.mustache and the generated client to decode only byte bodies.
Validation and limits
Five tests exercise public AssetsApi calls: three regressions fail and two byte-body controls pass before; all five pass after. Broader suite, excluding an existing missing-model import: 274 pass / 5 fail after versus 269 pass / the same five fail on unchanged production code without the new tests. The missing list_real_time_dimensions_response_data model is absent from HEAD. Python 3.12 and pytest 8; the pinned pytest 4 is incompatible with that runtime. Changed files compile; diff check passes. No live Mux requests or full Python matrix run.
Prepared with AI assistance; maintainer review pending.
- Dominant language
- Python
- Stars
- 68
- Forks
- 17
- Avg merge
- 10h 50m
- Merged PRs (30d)
- 3
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from muxinc/mux-python
-
Difficulty 1/5 Under an hour Newbie friendliness 53/100
muxinc/mux-python#54 · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
muxinc/mux-python#53 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 18/100
muxinc/mux-python#38 · 7 comments · 4 reactions ·
All issues in muxinc/mux-python
Similar issues
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
MakazhanAlpamys/Soup#3589 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/clickhouse-connect#1266 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
biosustain/growthcurves_app#89 ·
Maintainers usually reply within 1 day
-
`LogProxyConsumer._on_relation_departed` raises `APIError` when the promtail service does not existOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
canonical/loki-k8s-operator#695 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day