Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Skip the voucher refresh check when `refresh_date` is empty or null rather than only when the key is absent, instead of raising a `TypeError` (#268)
- Treat an unknown `publication_datetime` as published rather than crashing, and let `ItemNotPublished` report the ASIN without a countdown when no usable date is available (#268)
- Reach `LicenseDenied` and `NoDownloadUrl` as intended when `license_denial_reasons`, `content_metadata` or `content_url` are null, instead of raising a `TypeError` or `AttributeError` (#268)
- `audible manage config edit` no longer crashes with `TypeError: 'PosixPath' object is not iterable`; `click.edit()` accepts a `str` or an iterable of them, but not a `pathlib.Path` (#248)

## [0.4.0] - 2026-07-20

Expand Down
3 changes: 2 additions & 1 deletion src/audible_cli/cmds/cmd_manage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
import pathlib

import click
Expand Down Expand Up @@ -38,7 +39,7 @@ def manage_auth_files():
@pass_session
def config_editor(session):
"""Open the config file with default editor"""
click.edit(filename=session.config.filename)
click.edit(filename=os.fspath(session.config.filename))


@manage_profiles.command("list")
Expand Down
25 changes: 25 additions & 0 deletions tests/test_cmd_manage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
import pathlib
from unittest import mock

from click.testing import CliRunner

from audible_cli.cmds.cmd_manage import cli
from audible_cli.config import Session


def test_config_edit_passes_str_path_to_click_edit(tmp_path):
"""Click >= 8.2 takes a `str` or an iterable of them, but not a `Path`."""
config_file = tmp_path / "config.toml"
config_file.write_text("[APP]\n")

session = Session()
session._config = mock.Mock(filename=pathlib.Path(config_file))

runner = CliRunner()
with mock.patch("audible_cli.cmds.cmd_manage.click.edit") as edit:
result = runner.invoke(cli, ["config", "edit"], obj=session)

assert result.exit_code == 0, result.output
edit.assert_called_once_with(filename=os.fspath(config_file))
assert isinstance(edit.call_args.kwargs["filename"], str)