pjf / ipc-system-simple

Perl module to make running system commands and capturing errors as simple as possible.
http://search.cpan.org/perldoc?IPC::System::Simple
Other
19 stars 20 forks source link

runx Sometimes Fails to Pass Paths with Spaces In Them on Windows #24

Open theory opened 7 years ago

theory commented 7 years ago

As originally reported in /theory/sqitch#331. Note that the OP, @NorthLarry, found that passing a path with a space to psql failed, but not when passing it to notepad. Both work fine on the command-line, of course.

Tests:

perl -MIPC::System::Simple=runx -e "runx @ARGV" psql -f "C:\path\with some spaces/deploy/some_script.sql"
perl -MIPC::System::Simple=runx -e "runx @ARGV" notepad "C:\path\with some spaces/deploy/some_script.sql"
autarch commented 7 years ago

Dupe of #22 and several others, I think.

Basically the docs lie completely about the actual behavior on Windows. It always invokes a shell there, regardless of what sub you call or how you pass your args.

theory commented 7 years ago

Would be good, then, if the Windows code properly escaped/quoted args before shelling, to prevent shell interpretation.

autarch commented 7 years ago

Yeah, I agree. I just encountered this issue myself.

jkeenan commented 4 years ago

Is this the same problem as was described in https://rt.cpan.org/Ticket/Display.html?id=52380?

autarch commented 4 years ago

@jkeenan yes, I think so.

jkeenan commented 4 years ago

I believe that this issue may be resolved in IPC-System-Simple version 1.30, just released to CPAN. Can you confirm?

Thank you very much. Jim Keenan

autarch commented 4 years ago

I wish I remembered what I was doing when I encountered this. But I think it's a fairly simple test. Try to call an executable with a path containing spaces and pass it arguments.

jkeenan commented 4 years ago

On 3/23/20 10:03 PM, Dave Rolsky wrote:

I wish I remembered what I was doing when I encountered this. But I think it's a fairly simple test. Try to call an executable with a path containing spaces and pass it arguments.

I don't have Windows, so I'm flying blind here and need Windows-users to report results.

Thanks. jimk

autarch commented 4 years ago

Ok, I can confirm that this appears to be fixed.

jkeenan commented 4 years ago

Ok, I can confirm that this appears to be fixed.

Thanks, Dave. Closing.