PlatformIO Community

Space in path causes error


#1

Hello,

I’ve recently bought an arduino but I really wasn’t happy about the default IDE,
so I searched and found PlatformIO (installed on Visual Studio Code).

When I initialize, it works, but when I try to build I get following errormessage:
(I try to build it with the keyboard shortcut (ctrl + alt + b)).

It’s definitly because there is a space in my name but I don’t know how and where to fix this.
I also get some warnings about a space in the output window:

Warning: the task ‘PlatformIO: Build’ is a shell command and either the command name or one of its arguments has unescaped spaces. To ensure correct command line quoting please merge args into the command.

I get one of these for every built-in command there is.
Anyone that can help?

Thanks in advance!


#2

Thanks a lot! I’ve just fixed it!

Please run pio upgrade command in Terminal and Rebuild Project Index (Ctrl+P > PlatformIO: Rebuild…)


#3

Somehow those quotes don’t help to escape whitespaces, so exceptions persists.

My current solution is to use PowerShell whitespace escaping:

...
"command": "C:\\Users\\Yegor` Bobrovski\\.platformio\\penv\\Scripts\\platformio.exe",
"isShellCommand": true,
...

But platformio overrides my changes on every index rebuild.

Well, another solution is to leave only

"command": "platformio.exe"

and add its location folder to PATH.


#4

Honestly I didn’t test it because I couldn’t find the time until now. Escaping the " characters doesn’t work for me either.
Instead of escaping the " character I use the following: what seems to work for me:

...
"command": "&'C:\\Users\\Jeroen Claessens\\.platformio\\penv\\Scripts\\platformio.exe'",
"isShellCommand": false,
...

@ivankravets I created a pull request so please take a look into it:

I noticed that I needed to sign a contribution agreement, which I did after I filed the request.

Thanks.


#5

@Milquour @jclaessens97 could you try upcoming 0.5.0 beta?


#6

Just sharing another note about spaces in the path. If there are doublespaces in the path, that will also cause trouble upon compiling:

Error: Nothing to build. Please put your source code files to 'c:\Users\Rob\Documents\PlatformIO\Projects\1.0 Folder with double spaces\Smokey\src' folder

The compiler converts double spaces to single and then cant find the source files.

Cheers

rob