fix: pass config path to click.edit as a string - #269
Conversation
`audible manage config edit` called `click.edit(filename=...)` with the `pathlib.Path` returned by `session.config.filename`. Click >= 8.2 passes that value straight to `Editor.edit_files()", which iterates it, so the command aborted with `TypeError: 'WindowsPath' object is not iterable`. Convert the path with `os.fspath()` before handing it to Click. Adds a regression test asserting the filename reaching `click.edit` is a string.
|
Thanks for the fix, and for including a regression test. Could you rebase onto current I have reviewed the change itself and reproduced the bug on |
|
Reviewed in detail. The diagnosis is right and the fix is correct — I reproduced the crash on
Two things to change while you rebase: 1. Changelog wording. Click 8.2+ does not require a string — it accepts
2. Test docstring at Optional nit: One note that is on us, not you: this would be the first real test in the repo. |
Closes #248
audible manage config editpassed thepathlib.Pathfromsession.config.filenametoclick.edit(filename=...). Click >= 8.2 hands that value straight toEditor.edit_files(), which iterates it, so the command aborted withTypeError: 'WindowsPath' object is not iterable. Converting withos.fspath()fixes it — this is the approach you outlined on the issue.Added
tests/test_cmd_manage.py, which asserts the filename reachingclick.editis a string; it fails on the current code and passes with the fix. Also added a CHANGELOG entry under Unreleased/Fixed.This change was prepared with AI assistance; the regression test was run locally and fails without the fix.