Skip to content

Commit 90cf3a4

Browse files
committed
mpremote/mip: Raise an error if a file URL contains backslashes.
Warn the user that file URLs with backslashes are not supported, and suggest using forward slashes instead. Signed-off-by: Glenn Moloney <glenn.moloney@gmail.com>
1 parent cf3ea0d commit 90cf3a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/mpremote/mpremote/mip.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ def _download_file(transport, url, dest):
7777
except urllib.error.URLError as e:
7878
raise CommandError(f"{e.reason} requesting {url}")
7979
else:
80+
if "\\" in url:
81+
raise CommandError(
82+
f"File URLs with backslashes are not supported: {url!r}\n"
83+
'Use "//" instead of "\\" in the URL.'
84+
)
8085
try:
8186
with open(url, "rb") as f:
8287
data = f.read()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy