Marlin icon indicating copy to clipboard operation
Marlin copied to clipboard

Fix LPC1768 upload path autodetection

Open Renaud11232 opened this issue 1 year ago • 1 comments

Description

This PR adds a missing / in the path used to autodetect the upload path for LPC1768. Without this change, the upload_extra_script.py script does look in ./media instead of /media resulting in the following error:

Unable to find destination disk ([Errno 2] No such file or directory: 'media/renaud')

Requirements

Any LPC1768 board Attempting to upload the compiled firmware on a Linux machine

Benefits

It fixes the upload_port detection

Configurations

If testing on an SKR 1.3, you can use my configuration files available here

Related Issues

None

Renaud11232 avatar Sep 18 '22 08:09 Renaud11232

I was curious...

It was lost in this commit https://github.com/MarlinFirmware/Marlin/pull/24574/files#diff-3a47e0ceb8cdb02b169672e01b275eab935b9752b2527dcc85dd2c56619ca0bd

used to be

upload_disk = os.path.join(os.sep, 'media', getpass.getuser(),

now

				user = getpass.getuser()
				mpath = Path('media', user)

ie it lost the "os.sep"
Since this is always / on linux. Your fix is fine (in my view)

ellensp avatar Sep 18 '22 13:09 ellensp

ie it lost the "os.sep"

Pathlib has some nice shortcuts so you can think less about separators, as in this case.

thinkyhead avatar Sep 22 '22 16:09 thinkyhead