[PyQt] QUrl paths under Windows seem weird

Grzegorz Adam Hankiewicz gradha at titanium.sabren.com
Fri Feb 6 13:48:39 GMT 2009


I'm implementing a drag and drop application where the user drags  
files from the explorer and drops them on a label. The label processes  
the files and loads them.

Under MacOSX this is working all well, but under Windows I am getting  
paths like u"/C:/Documents and Settings/blah blah". Certainly the  
leading slash is not welcome. How come it got into there and how  
should I remove it?

I know I can remove the first slash under Windows (I've just done it  
and works ok), but I would prefer to not have platform specific code.  
Is there any Qt normalization path which will return something I can  
pass to open() without having to parse it first?

More information about the PyQt mailing list