asweigart / asweigart/pyaudacity

pa.get_info() fails with PyAudacityException: format argument must be one of "JSON", "LISP", or "Brief"

Open
#4 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
38
Forks
8
PR merge metrics
No merged PRs in 30d

Description

```python
import pyaudacity as pa
pa.get_info()
```
fails with `PyAudacityException: format argument must be one of "JSON", "LISP", or "Brief"`.

Reason: The `format`-parameter is initialized with `"JSON"` and [subsequently `title()`-fied](https://github.com/asweigart/pyaudacity/blob/main/src/pyaudacity/__init__.py#L3730) which turns it into `"Json"`, which makes it impossible to pass anything for the `format`-parameter but `"Brief"`.

Fix: remove [call](https://github.com/asweigart/pyaudacity/blob/main/src/pyaudacity/__init__.py#L3730) to `title()` on parameter `format`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open src/pyaudacity/__init__.py around line 3730 and inspect how get_info() normalizes its format parameter. Run the reported pa.get_info() snippet before and after the change, then verify that the default call succeeds and the documented JSON, LISP, and Brief formats remain accepted.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.