Skip to content
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

Save as fails when the path to the sketch contains parentheses () or brackets [] #2043

Closed
3 tasks done
kittaakos opened this issue May 4, 2023 · 0 comments · Fixed by #2046 or greenpdx/arduino-ide#1
Closed
3 tasks done
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@kittaakos
Copy link
Contributor

kittaakos commented May 4, 2023

Describe the problem

Originally from here: https://forum.arduino.cc/t/new-ide-inst-saving-files-correctly/1122494

Save as fails when the sketch path contains

  • parentheses ()
  • brackets []
  • TODO: check braces {} (it works ✅) and chevrons <> (it works ✅)

Windows:

2023-05-04T10:08:56.640Z root ERROR Request copy failed with error: Cannot copy `c:\Users\kittaakos\Desktop\sketchbooks\test_sketchbook__1\nested(with parentheses)\sketch_3`: the file doesn't exist

macOS:

2023-05-04T10:21:50.093Z root ERROR Request copy failed with error: Cannot copy `/Users/a.kitta/Documents/Arduino/with ()/nested_korte`: the file doesn't exist

To reproduce

  • Open a sketch in IDE2 that has parentheses in the path,
  • Click on File > Save as,
  • Specify a valid sketch folder name, and press OK.

It does not work.


My sketchbook content:

C:\Users\kittaakos\Desktop\sketchbooks\test_sketchbook__1>dir
 Volume in drive C has no label.
 Volume Serial Number is 04F3-13CC

 Directory of C:\Users\kittaakos\Desktop\sketchbooks\test_sketchbook__1

05/04/2023  12:07 PM    <DIR>          .
05/04/2023  12:07 PM    <DIR>          ..
01/19/2023  11:18 AM    <DIR>          nested
05/04/2023  12:08 PM    <DIR>          nested(with parentheses)
01/19/2023  11:18 AM    <DIR>          sketch++
01/19/2023  11:18 AM    <DIR>          sketch_xxx
01/19/2023  11:19 AM    <DIR>          __sketch
               0 File(s)              0 bytes
               7 Dir(s)  217,251,553,280 bytes free

C:\Users\kittaakos\Desktop\sketchbooks\test_sketchbook__1>tree
Folder PATH listing
Volume serial number is 04F3-13CC
C:.
├───nested
│   └───sketch_2
├───nested(with parentheses)
│   └───sketch_3
├───sketch++
├───sketch_xxx
└───__sketch

C:\Users\kittaakos\Desktop\sketchbooks\test_sketchbook__1>

I opened nested(with parentheses)/sketch_3 and performed the Save as command.

Expected behavior

It works.

Arduino IDE version

2.1.0

Operating system

Windows, macOS

Operating system version

macOS 12.6.3 and Windows 10

Additional context

From #1901 (comment):

Thanks! I could reproduce it when creating a cloud copy without renaming the local sketch. The problem was in ncp, so I switched to a new lib and added a few tests.

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@kittaakos kittaakos added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels May 4, 2023
@kittaakos kittaakos self-assigned this May 4, 2023
@kittaakos kittaakos changed the title Save as fails when the path to the sketch contains parentheses () Save as fails when the path to the sketch contains parentheses () or brackets [] May 4, 2023
kittaakos pushed a commit that referenced this issue May 4, 2023
Changed the `source` and `cwd` args to avoid accidentally creating an
invalid `glob` patterns when doing the brace expansion by `cpy`.

Closes #2043

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue May 5, 2023
Changed the `source` and `cwd` args to avoid accidentally creating an
invalid `glob` patterns when doing the brace expansion by `cpy`.

Closes #2043

Signed-off-by: Akos Kitta <[email protected]>
kittaakos pushed a commit that referenced this issue May 6, 2023
Changed the `source` and `cwd` args to avoid accidentally creating an
invalid `glob` patterns when doing the brace expansion by `cpy`.

Closes #2043

Signed-off-by: Akos Kitta <[email protected]>
@per1234 per1234 added the conclusion: resolved Issue was resolved label May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
2 participants