don't understand popen2

Kent Johnson kent at kentsjohnson.com
Fri Mar 24 23:31:05 EST 2006


Sion Arrowsmith wrote:
> Kent Johnson  <kent at kentsjohnson.com> wrote:
> 
>>Sion Arrowsmith wrote:
>>
>>>(and please avoid the abuse of raw strings for Windows paths).
>>
>>Why do you consider that abuse of raw strings?
> 
> I consider it abuse because it's not what they were invented for.
> I consider discouraging it to be a good thing in order to reduce
> the chances of people being bitten by, for instance:
> 
>>>>os.listdir(r"C:\")
> 
>   File "<stdin>", line 1
>     os.listdir(r"C:\")
>                      ^
> SyntaxError: EOL while scanning single-quoted string
> 
> and getting all confused on this group.

Judging from the traffic here, people are far more often bitten by *not* 
using raw strings for paths containing \ than they are by using them for 
paths ending with \. So perhaps we should encourage raw strings for 
Windows paths. ;)

Kent



More information about the Python-list mailing list