← index #17267PR #16164
Related · high · value 1.773
QUERY · ISSUE

mpremote gives false error if a destination directory doesn't exist for recursive copy

openby mattvennopened 2025-05-08updated 2025-09-05
bugtools

Port, board and/or hardware

rp2040

MicroPython version

MicroPython v1.24.0 on 2024-10-25; Raspberry Pi Pico with RP2040

Reproduction

create a directory 'test' on the target and 'local' on host
then run:

mpremote cp -r local  :testt 

note typo in destination

Expected behaviour

the error message should be 'destination doesn't exist'

Observed behaviour

cp local :testt
mpremote: cp: -r not specified; omitting directory

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

tools/mpremote: Support trailing slash on dest for non-recursive copy.

mergedby dpgeorgeopened 2024-11-06updated 2024-11-13
tools

Summary

This fixes a regression in db59e55fe7a0b67d3af868990468e7b8056afe42: prior to that commit mpremote supported trailing slashes on the destination of a normal (non-recursive) copy.

Add back support for that, with the semantics that a trailing slash requires the destination to be an existing directory.

Testing

A test has been added to the mpremote tests (also a test for force copy, in a separate commit). As part of getting the test working, needed to flush stdout before printing error messages to stderr.

The mpremote tests were then run on a PYBD_SF2. They passed.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied