[Interest] script invoked with QProcess cannot open files with spaces in path

Thiago Macieira thiago.macieira at intel.com
Wed Aug 31 01:50:37 CEST 2016


Em terça-feira, 30 de agosto de 2016, às 19:30:35 PDT, Larry Martell escreveu:
> On Tue, Aug 30, 2016 at 7:08 PM, Thiago Macieira
> 
> <thiago.macieira at intel.com> wrote:
> > Em terça-feira, 30 de agosto de 2016, às 16:28:25 PDT, Larry Martell 
escreveu:
> >> I am invoking a python script with QProcess. I have found that if the
> >> script tries to open a file that has spaces in the path, no error is
> >> thrown, but the file always appears to have 0 length. The same script
> >> with the same file with spaces in the path invoked from the command
> >> line works fine. Note that this has nothing to do with argument
> >> passing from the C++ code to the script via QProcess - the file path
> >> name is hardcoded in the script. If the file has no spaces in its path
> >> it is opened fine. I have tied escaping the spaces with \ but no joy.
> >> Anyone know why this would be happening and know a way around this?
> > 
> > It's very hard to even begin to guess where the problem is. From what
> > you've described the problem is on the Python side, which means my
> > knowledge drops to about zero.
> 
> Yes, my initial though was that it was on the python side, but the
> same script run from the command line works fine.

Well, my initial thought is the argument passing, but you said it can't be 
either :-)

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list