Inconsistent supported media types in `client.media.upload()`: `.wav` rejected, `.mpeg` accepted but not listed in error message
还没有人认领这个 Issue。
评估
调研方向
Start with plivo/resources/media.py and reproduce the WAV and MPEG cases described in the issue. Compare the SDK validation and error message with the linked Plivo Media API documentation, then verify that the supported formats, validation behavior, and reported message agree. Done means the intended audio/video formats are consistently handled and documented.
由索引模型根据 Issue 内容生成。
描述
Description
When calling client.media.upload() in the Plivo Python SDK, I receive an error that only image files (JPG, JPEG, PNG and PDF) are allowed, despite documentation and SDK code indicating support for audio/video types.
Steps to Reproduce
-
Install the Plivo Python SDK:
pip install plivo -
Attempt to upload a WAV file:
from plivo import RestClient
client = RestClient("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")
client.media.upload(["example.wav", ])
- Observe the error:
{
"error": "File format of the file to be uploaded should be one of JPG, JPEG, PNG or PDF"
}
- Attempt to upload an MPEG file:
client.media.upload(["example.mpeg", ])
- The upload succeeds and do not produce listed error message.
Expected Behavior
- WAV uploads are accepted per the documentation.
- MPEG uploads succeed in practice and should be recognized in the error message.
- The SDK error message and documentation should list all supported MIME types.
Actual Behavior
- WAV uploads are rejected while only listing image and PDF types.
- MPEG uploads succeed despite not being mentioned in the error output.
Environment
- plivo-python version: latest
- Python version: 3.12
- Operating System: Windows10
References
Plivo Media API documentation
SDK source with error logic
Suggested Fix
Update the SDK to include audio/video extensions (wav, mpeg, etc.) in the allowed list and error message.
Or clarify documentation if certain formats like wav are not intended to be accepted.
- 主要语言
- Python
- 星标
- 69
- 派生
- 68
- 平均合并
- 2 天 5 小时
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
plivo/plivo-python 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
plivo/plivo-python#298 · 1 条评论 · 2 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 25/100
plivo/plivo-python#290 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
plivo/plivo-python#289 ·
-
难度 4/5 3-5 天 新手友好度 25/100
plivo/plivo-python#286 ·
-
难度 1/5 1 小时以内 新手友好度 55/100
plivo/plivo-python#283 ·
查看 plivo/plivo-python 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
mishraprafful/multihull#150 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
python-caldav/caldav#735 ·
维护者通常 1 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 68/100
mealie-recipes/mealie#8682 ·
维护者通常 1 天内回复
-
good first issue lane:repo
难度 2/5 1-3 小时 新手友好度 85/100