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

オープン
#295 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
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
フォーク
67
PR マージ指標
30日以内にマージされた PR はありません

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

plivo/plivo-python のほかの issue

plivo/plivo-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。