Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Inconsistent supported media types in `client.media.upload()`: `.wav` rejected, `.mpeg` accepted but not listed in error message

未关闭
#295 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
api

调研方向

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

  1. Install the Plivo Python SDK:

     pip install plivo
    
  2. Attempt to upload a WAV file:

from plivo import RestClient

client = RestClient("YOUR_AUTH_ID", "YOUR_AUTH_TOKEN")
client.media.upload(["example.wav", ])

  1. Observe the error:
{
  "error": "File format of the file to be uploaded should be one of JPG, JPEG, PNG or PDF"
}
  1. Attempt to upload an MPEG file:
client.media.upload(["example.mpeg", ])
  1. 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

Image

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 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

plivo/plivo-python 的其他 Issue

查看 plivo/plivo-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。