Popen and wget, problems

js ebgssth at gmail.com
Sun May 13 06:01:11 EDT 2007


Hi Jesse.

> cmd_set = ['wget', '-nv', '-O dir/cpan.txt', 'http://search.span.org']
[snip]
>proc = Popen(cmd_set, stdout=PIPE, stderr=PIPE)

wget will treat this as
$ wget -nv '-O dir/cpan.txt' "http://search.cpan.org"

And will emit the following error because there's no pathname ' dir/cpan.txt'.
(Note the pathname has a trailing space.)

 dir/cpan.txt: No such file or directory

Replace '-O dir/cpan.txt" with '-Odir/cpan.txt' or '-O', 'dir/cpan.txt'
and it should work.

Hope this helps



More information about the Python-list mailing list