-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
mpremote mkdir crashes on Windows if path does not start with : #17093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Could you rerun your scenario with |
just for clarity: This report is for the error in mpremote, not regarding the bash test harness. the workaround is simple: use a I Suggest to:
if I set a breakpoint on entry and look at the arguments passed to Python
I syspect that this is a (unexpected) side effect ot the way Git bash tries to translate absolute paths between the Posix universe with a single tree , and the Windows universe that allows both drive letters , and mount points. #Git Bash
$ mount
C:/Program Files/Git on / type ntfs (binary,noacl,auto)
C:/Program Files/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C:/Users/josverl/AppData/Local/Temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
D: on /d type refs (binary,noacl,posix=0,user,noumount,auto)
E: on /e type ntfs (binary,noacl,posix=0,user,noumount,auto)
F: on /f type vfat (binary,noacl,posix=0,user,noumount,auto) bash Details
likely not relevant as explained above
|
This is a bizarre bug. I've checked, this also happens with jq but NOT with the utilities that ship with Git Bash. Ordinary quoting doesn't seem to prevent it -- Test Script#!/bin/bash
set -x
cat <<<'==================== Test Script ===================='
TEST_SH=$(mktemp --suffix=.sh)
tee $TEST_SH <<'TEST_SH'
set -x
f=/ramdisk/lib
ECHO_EXE=$(mktemp --suffix=.exe)
cp $(which echo) $ECHO_EXE
GREP_TXT=$(mktemp --suffix=.txt)
tee $GREP_TXT <<GREP_TXT
C:/Program Files/Git$f
did not expand $f if this line appears
GREP_TXT
ARGS_PY=$(mktemp --suffix=.py)
tee $ARGS_PY <<ARGS_PY
import sys
print(sys.argv)
ARGS_PY
cat <<<'--------------- echo: shell builtin? ----------------'
echo $f
echo ${f@Q}
echo \'$f\'
cat <<<'------------------ echo: echo.exe -------------------'
$ECHO_EXE $f
$ECHO_EXE ${f@Q}
$ECHO_EXE \'$f\'
cat <<<'----------- grep: winget install Git.Git ------------'
grep -F $f <$GREP_TXT
grep -F ${f@Q} <$GREP_TXT
grep -F \'$f\' <$GREP_TXT
cat <<<'---- python: winget install Anaconda.Miniconda3 -----'
python $ARG_PY -- $f
python $ARG_PY -- ${f@Q}
python $ARG_PY -- \'$f\'
cat <<<'----------- jq: winget install jqlang.jq ------------'
jq '{"file":input_filename}' $f
jq '{"file":input_filename}' ${f@Q}
jq '{"file":input_filename}' \'$f\'
TEST_SH
cat <<<'=================== Git /bin/bash ==================='
'C:/Program Files/Git/bin/bash.exe' $TEST_SH
cat <<<'================= Git /usr/bin/bash ================='
'C:/Program Files/Git/usr/bin/bash.exe' $TEST_SH
cat <<<'=============== GAP Runtime /bin/bash ==============='
"C:/Program Files/GAP-v4.12.2/runtime/bin/bash.exe" $TEST_SH Test Output+ cat
==================== Test Script ====================
++ mktemp --suffix=.sh
+ TEST_SH=/tmp/tmp.lk3e6ypFTY.sh
+ tee /tmp/tmp.lk3e6ypFTY.sh
set -x
f=/ramdisk/lib
ECHO_EXE=$(mktemp --suffix=.exe)
cp $(which echo) $ECHO_EXE
GREP_TXT=$(mktemp --suffix=.txt)
tee $GREP_TXT <<GREP_TXT
C:/Program Files/Git$f
did not expand $f if this line appears
GREP_TXT
ARGS_PY=$(mktemp --suffix=.py)
tee $ARGS_PY <<ARGS_PY
import sys
print(sys.argv)
ARGS_PY
cat <<<'--------------- echo: shell builtin? ----------------'
echo $f
echo ${f@Q}
echo \'$f\'
cat <<<'------------------ echo: echo.exe -------------------'
$ECHO_EXE $f
$ECHO_EXE ${f@Q}
$ECHO_EXE \'$f\'
cat <<<'----------- grep: winget install Git.Git ------------'
grep -F $f <$GREP_TXT
grep -F ${f@Q} <$GREP_TXT
grep -F \'$f\' <$GREP_TXT
cat <<<'---- python: winget install Anaconda.Miniconda3 -----'
python $ARG_PY -- $f
python $ARG_PY -- ${f@Q}
python $ARG_PY -- \'$f\'
cat <<<'----------- jq: winget install jqlang.jq ------------'
jq '{"file":input_filename}' $f
jq '{"file":input_filename}' ${f@Q}
jq '{"file":input_filename}' \'$f\'
+ cat
=================== Git /bin/bash ===================
+ 'C:/Program Files/Git/bin/bash.exe' /tmp/tmp.lk3e6ypFTY.sh
+ f=/ramdisk/lib
++ mktemp --suffix=.exe
+ ECHO_EXE=/tmp/tmp.PmFDkbSI3e.exe
++ which echo
+ cp /usr/bin/echo /tmp/tmp.PmFDkbSI3e.exe
++ mktemp --suffix=.txt
+ GREP_TXT=/tmp/tmp.2rfKR4vkkb.txt
+ tee /tmp/tmp.2rfKR4vkkb.txt
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
++ mktemp --suffix=.py
+ ARGS_PY=/tmp/tmp.1PcpR8OhaP.py
+ tee /tmp/tmp.1PcpR8OhaP.py
import sys
print(sys.argv)
+ cat
--------------- echo: shell builtin? ----------------
+ echo /ramdisk/lib
/ramdisk/lib
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ cat
------------------ echo: echo.exe -------------------
+ /tmp/tmp.PmFDkbSI3e.exe /ramdisk/lib
/ramdisk/lib
+ /tmp/tmp.PmFDkbSI3e.exe ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ /tmp/tmp.PmFDkbSI3e.exe ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ cat
----------- grep: winget install Git.Git ------------
+ grep -F /ramdisk/lib
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ grep -F ''\''/ramdisk/lib'\'''
+ grep -F ''\''/ramdisk/lib'\'''
+ cat
---- python: winget install Anaconda.Miniconda3 -----
+ python -- /ramdisk/lib
C:\Users\anson\anaconda3\envs\py311\python.exe: can't open file 'C:\\Program Files\\Git\\ramdisk\\lib': [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\envs\py311\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\envs\py311\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ cat
----------- jq: winget install jqlang.jq ------------
+ jq '{"file":input_filename}' /ramdisk/lib
jq: error: Could not open file C:/Program Files/Git/ramdisk/lib: No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ cat
================= Git /usr/bin/bash =================
+ 'C:/Program Files/Git/usr/bin/bash.exe' /tmp/tmp.lk3e6ypFTY.sh
+ f=/ramdisk/lib
++ mktemp --suffix=.exe
+ ECHO_EXE=/tmp/tmp.raBm24eVEw.exe
++ which echo
+ cp /usr/bin/echo /tmp/tmp.raBm24eVEw.exe
++ mktemp --suffix=.txt
+ GREP_TXT=/tmp/tmp.BBpae5HIWh.txt
+ tee /tmp/tmp.BBpae5HIWh.txt
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
++ mktemp --suffix=.py
+ ARGS_PY=/tmp/tmp.nywNzhqlo5.py
+ tee /tmp/tmp.nywNzhqlo5.py
import sys
print(sys.argv)
+ cat
--------------- echo: shell builtin? ----------------
+ echo /ramdisk/lib
/ramdisk/lib
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ cat
------------------ echo: echo.exe -------------------
+ /tmp/tmp.raBm24eVEw.exe /ramdisk/lib
/ramdisk/lib
+ /tmp/tmp.raBm24eVEw.exe ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ /tmp/tmp.raBm24eVEw.exe ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ cat
----------- grep: winget install Git.Git ------------
+ grep -F /ramdisk/lib
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ grep -F ''\''/ramdisk/lib'\'''
+ grep -F ''\''/ramdisk/lib'\'''
+ cat
---- python: winget install Anaconda.Miniconda3 -----
+ python -- /ramdisk/lib
C:\Users\anson\anaconda3\envs\py311\python.exe: can't open file 'C:\\Program Files\\Git\\ramdisk\\lib': [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\envs\py311\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\envs\py311\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ cat
----------- jq: winget install jqlang.jq ------------
+ jq '{"file":input_filename}' /ramdisk/lib
jq: error: Could not open file C:/Program Files/Git/ramdisk/lib: No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ cat
=============== GAP Runtime /bin/bash ===============
+ 'C:/Program Files/GAP-v4.12.2/runtime/bin/bash.exe' /tmp/tmp.lk3e6ypFTY.sh
+ f=/ramdisk/lib
++ mktemp --suffix=.exe
+ ECHO_EXE=/tmp/tmp.9WMs52PPd9.exe
++ which echo
+ cp /usr/bin/echo /tmp/tmp.9WMs52PPd9.exe
++ mktemp --suffix=.txt
+ GREP_TXT=/tmp/tmp.SbcrYKdzIO.txt
+ tee /tmp/tmp.SbcrYKdzIO.txt
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
++ mktemp --suffix=.py
+ ARGS_PY=/tmp/tmp.YF7qTMspx7.py
+ tee /tmp/tmp.YF7qTMspx7.py
import sys
print(sys.argv)
+ cat
--------------- echo: shell builtin? ----------------
+ echo /ramdisk/lib
/ramdisk/lib
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ cat
------------------ echo: echo.exe -------------------
+ /tmp/tmp.9WMs52PPd9.exe /ramdisk/lib
/ramdisk/lib
+ /tmp/tmp.9WMs52PPd9.exe ''\''/ramdisk/lib'\'''
/ramdisk/lib
+ /tmp/tmp.9WMs52PPd9.exe ''\''/ramdisk/lib'\'''
/ramdisk/lib
+ cat
----------- grep: winget install Git.Git ------------
+ grep -F /ramdisk/lib
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ grep -F ''\''/ramdisk/lib'\'''
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ grep -F ''\''/ramdisk/lib'\'''
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ cat
---- python: winget install Anaconda.Miniconda3 -----
+ python -- /ramdisk/lib
C:\Users\anson\anaconda3\envs\py311\python.exe: can't open file 'C:\\ramdisk\\lib': [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\envs\py311\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\envs\py311\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ cat
----------- jq: winget install jqlang.jq ------------
+ jq '{"file":input_filename}' /ramdisk/lib
jq: error: Could not open file /ramdisk/lib: No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory |
Deactivating my conda environment didn't change anything. Test Output+ cat
==================== Test Script ====================
++ mktemp --suffix=.sh
+ TEST_SH=/tmp/tmp.uzccWES4V2.sh
+ tee /tmp/tmp.uzccWES4V2.sh
set -x
f=/ramdisk/lib
ECHO_EXE=$(mktemp --suffix=.exe)
cp $(which echo) $ECHO_EXE
GREP_TXT=$(mktemp --suffix=.txt)
tee $GREP_TXT <<GREP_TXT
C:/Program Files/Git$f
did not expand $f if this line appears
GREP_TXT
ARGS_PY=$(mktemp --suffix=.py)
tee $ARGS_PY <<ARGS_PY
import sys
print(sys.argv)
ARGS_PY
cat <<<'--------------- echo: shell builtin? ----------------'
echo $f
echo ${f@Q}
echo \'$f\'
cat <<<'------------------ echo: echo.exe -------------------'
$ECHO_EXE $f
$ECHO_EXE ${f@Q}
$ECHO_EXE \'$f\'
cat <<<'----------- grep: winget install Git.Git ------------'
grep -F $f <$GREP_TXT
grep -F ${f@Q} <$GREP_TXT
grep -F \'$f\' <$GREP_TXT
cat <<<'---- python: winget install Anaconda.Miniconda3 -----'
python $ARG_PY -- $f
python $ARG_PY -- ${f@Q}
python $ARG_PY -- \'$f\'
cat <<<'----------- jq: winget install jqlang.jq ------------'
jq '{"file":input_filename}' $f
jq '{"file":input_filename}' ${f@Q}
jq '{"file":input_filename}' \'$f\'
+ cat
=================== Git /bin/bash ===================
+ 'C:/Program Files/Git/bin/bash.exe' /tmp/tmp.uzccWES4V2.sh
+ f=/ramdisk/lib
++ mktemp --suffix=.exe
+ ECHO_EXE=/tmp/tmp.2n0dUffToi.exe
++ which echo
+ cp /usr/bin/echo /tmp/tmp.2n0dUffToi.exe
++ mktemp --suffix=.txt
+ GREP_TXT=/tmp/tmp.TKf0XQyL6D.txt
+ tee /tmp/tmp.TKf0XQyL6D.txt
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
++ mktemp --suffix=.py
+ ARGS_PY=/tmp/tmp.JjNMTsbgk3.py
+ tee /tmp/tmp.JjNMTsbgk3.py
import sys
print(sys.argv)
+ cat
--------------- echo: shell builtin? ----------------
+ echo /ramdisk/lib
/ramdisk/lib
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ cat
------------------ echo: echo.exe -------------------
+ /tmp/tmp.2n0dUffToi.exe /ramdisk/lib
/ramdisk/lib
+ /tmp/tmp.2n0dUffToi.exe ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ /tmp/tmp.2n0dUffToi.exe ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ cat
----------- grep: winget install Git.Git ------------
+ grep -F /ramdisk/lib
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ grep -F ''\''/ramdisk/lib'\'''
+ grep -F ''\''/ramdisk/lib'\'''
+ cat
---- python: winget install Anaconda.Miniconda3 -----
+ python -- /ramdisk/lib
C:\Users\anson\anaconda3\python.exe: can't open file 'C:\\Program Files\\Git\\ramdisk\\lib': [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ cat
----------- jq: winget install jqlang.jq ------------
+ jq '{"file":input_filename}' /ramdisk/lib
jq: error: Could not open file C:/Program Files/Git/ramdisk/lib: No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ cat
================= Git /usr/bin/bash =================
+ 'C:/Program Files/Git/usr/bin/bash.exe' /tmp/tmp.uzccWES4V2.sh
+ f=/ramdisk/lib
++ mktemp --suffix=.exe
+ ECHO_EXE=/tmp/tmp.6bgdoDNVxQ.exe
++ which echo
+ cp /usr/bin/echo /tmp/tmp.6bgdoDNVxQ.exe
++ mktemp --suffix=.txt
+ GREP_TXT=/tmp/tmp.KyDz7L1cMT.txt
+ tee /tmp/tmp.KyDz7L1cMT.txt
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
++ mktemp --suffix=.py
+ ARGS_PY=/tmp/tmp.19JOuq4tiW.py
+ tee /tmp/tmp.19JOuq4tiW.py
import sys
print(sys.argv)
+ cat
--------------- echo: shell builtin? ----------------
+ echo /ramdisk/lib
/ramdisk/lib
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ cat
------------------ echo: echo.exe -------------------
+ /tmp/tmp.6bgdoDNVxQ.exe /ramdisk/lib
+ /tmp/tmp.6bgdoDNVxQ.exe ''\''/ramdisk/lib'\'''
+ /tmp/tmp.6bgdoDNVxQ.exe ''\''/ramdisk/lib'\'''
+ cat
----------- grep: winget install Git.Git ------------
+ grep -F /ramdisk/lib
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ grep -F ''\''/ramdisk/lib'\'''
+ grep -F ''\''/ramdisk/lib'\'''
+ cat
---- python: winget install Anaconda.Miniconda3 -----
+ python -- /ramdisk/lib
C:\Users\anson\anaconda3\python.exe: can't open file 'C:\\Program Files\\Git\\ramdisk\\lib': [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ cat
----------- jq: winget install jqlang.jq ------------
+ jq '{"file":input_filename}' /ramdisk/lib
jq: error: Could not open file C:/Program Files/Git/ramdisk/lib: No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ cat
=============== GAP Runtime /bin/bash ===============
+ 'C:/Program Files/GAP-v4.12.2/runtime/bin/bash.exe' /tmp/tmp.uzccWES4V2.sh
+ f=/ramdisk/lib
++ mktemp --suffix=.exe
+ ECHO_EXE=/tmp/tmp.A2T8P5Olgo.exe
++ which echo
+ cp /usr/bin/echo /tmp/tmp.A2T8P5Olgo.exe
++ mktemp --suffix=.txt
+ GREP_TXT=/tmp/tmp.SF3WOdenNf.txt
+ tee /tmp/tmp.SF3WOdenNf.txt
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
++ mktemp --suffix=.py
+ ARGS_PY=/tmp/tmp.g9fRmy01LN.py
+ tee /tmp/tmp.g9fRmy01LN.py
import sys
print(sys.argv)
+ cat
--------------- echo: shell builtin? ----------------
+ echo /ramdisk/lib
/ramdisk/lib
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ echo ''\''/ramdisk/lib'\'''
'/ramdisk/lib'
+ cat
------------------ echo: echo.exe -------------------
+ /tmp/tmp.A2T8P5Olgo.exe /ramdisk/lib
+ /tmp/tmp.A2T8P5Olgo.exe ''\''/ramdisk/lib'\'''
+ /tmp/tmp.A2T8P5Olgo.exe ''\''/ramdisk/lib'\'''
+ cat
----------- grep: winget install Git.Git ------------
+ grep -F /ramdisk/lib
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ grep -F ''\''/ramdisk/lib'\'''
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ grep -F ''\''/ramdisk/lib'\'''
C:/Program Files/Git/ramdisk/lib
did not expand /ramdisk/lib if this line appears
+ cat
---- python: winget install Anaconda.Miniconda3 -----
+ python -- /ramdisk/lib
C:\Users\anson\anaconda3\python.exe: can't open file 'C:\\ramdisk\\lib': [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ python -- ''\''/ramdisk/lib'\'''
C:\Users\anson\anaconda3\python.exe: can't open file "C:\\Users\\anson\\'\\ramdisk\\lib'": [Errno 2] No such file or directory
+ cat
----------- jq: winget install jqlang.jq ------------
+ jq '{"file":input_filename}' /ramdisk/lib
jq: error: Could not open file /ramdisk/lib: No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory
+ jq '{"file":input_filename}' ''\''/ramdisk/lib'\'''
jq: error: Could not open file '/ramdisk/lib': No such file or directory There doesn't seem to be any shell options or configuration set within the shell that even correspond to this -- not even just some environment variable with a value like |
Possibly in https://github.com/msys2/MSYS2-packages/tree/master/bash but not something we can solve here. |
Please relabel as [Docs] [Tests] |
It's possible there's something we could do about it for our own package. I'm currently looking into how it is that the programs that ship as built-in MSYS2 utilities are able to accept their path-like arguments untransformed -- since, one way or another, they definitely do receive their arguments without the transformation that Git Bash applies when running other programs like python and jq. |
Found a page that documents this feature of MSYS2, and environment variables that can switch it off: |
Try:
or
|
Just got my own Windows build environment working. I can confirm that setting As a somewhat clumsy first pass at an approach to fix, we could maybe add a launcher script, e.g. a file like MSYS2_ARG_CONV_EXCL=/ "${0%.sh}.py" "$@" Compare:
There might be a way to configure the |
I don't have time to test this now, but plan to look at this next week |
Port, board and/or hardware
Any, verified on esp32 and stm32
MicroPython version
mpflash list --json
[
{
"serialport": "COM24",
"connected": true,
"family": "micropython",
"description": "PYBv1.1 with STM32F405RG",
"version": "1.25.0-preview",
"port": "stm32",
"board": "PYBV11",
"variant": "DP_THREAD",
"cpu": "STM32F405RG",
"arch": "armv7emsp",
"mpy": "v6.3",
"build": "389",
"location": "1-6.1.1:x.1",
"toml": {}
}
]
Reproduction
The mip local install crashes in Git Bash on Windows
Note that this problem does NOT occur on Windows Powershell , it is Git Bash specific.
(this also means that Git bash is not a reliable tests environment for windows as a whole.)
Expected behaviour
Expected to create a folder in the ramdisk
Observed behaviour
Additional Information
discovered during attempts to test mpremote on windows.
Code of Conduct
Yes, I agree
The text was updated successfully, but these errors were encountered: