Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def validate_file_destination(namespace):
file_path = path
file_dir = os.path.dirname(path)
if os.path.isdir(path):
file_name = os.path.basename(namespace.file_name)
file_name = os.path.basename(namespace.file_path)
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validator now reads namespace.file_path, but the existing unit test test_batch_validate_file_destination still sets ns.file_name (see batch/tests/latest/test_batch_commands.py). CI will likely fail unless the test (and any other callers constructing a namespace for this validator) is updated to use file_path instead of file_name.

Suggested change
file_name = os.path.basename(namespace.file_path)
source_path = getattr(namespace, 'file_path', None) or getattr(namespace, 'file_name', None)
if not source_path:
raise ValueError("Missing file path for destination filename resolution.")
file_name = os.path.basename(source_path)

Copilot uses AI. Check for mistakes.
file_path = os.path.join(path, file_name)
elif not os.path.isdir(file_dir):
try:
Expand Down
Loading