TLS failures are masked by AttributeError when API exception body is None
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 68
- Fork
- 17
- Merge trung bình
- 10 giờ 50 phút
- Pull request đã merge (30 ngày)
- 3
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của muxinc/mux-python
-
Update `list exports` exampleĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 53/100
muxinc/mux-python#54 · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
muxinc/mux-python#53 ·
-
Add Mux webhook verificationĐang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
muxinc/mux-python#38 · 7 bình luận · 4 reaction ·
Tất cả issue của muxinc/mux-python
Issue tương tự
-
[19.0] pos_sale: settling an order with a 0 down payment line crashes (reading 'reward_id') and leaves a wrong amount dueCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 79/100
developmentseed/titiler-covjson#164 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
awslabs/visual-asset-management-system#2164 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
MakazhanAlpamys/Soup#3589 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
channels status reports the wrong Enabled value for Feishu instances and default-enabled WebSocketĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày