On 18/02/14 22:57, Pierre Fortin wrote:
Hi all, [pulling my hair out over this one...]
I have a python3 script that builds the .wgetrc* file and invokes wget...
it even prints out the command as invoked... should be easy, right?
If I issue the generated/printed command via cli, it works exactly as
expected.
However, when python3 issues the command, all looks well until it gets
and saves .listing, then.... it removes and replaces it with index.html
and silently quits...
Under what conditions would .listing get written, erased and replaced by
an index.html file, then, wget quits?
I get that behavior without your config file. As in that case it
doesn't have mirror nor recursive (they are set in your wgetrc), wget is
downloading the directory, which it durifully does by giving you an html
view of the ftp folder.
However, wget is recognising --config, and if it was missing/unreadable
it would have printed something like
wget: Cannot read /home/pfortin/.wgetrc.getMageia2.x86_64.4 (No such
file or directory).
As you are dinamically generating the wgetrc, is it possible that the
contents are still buffered in the python process when you spawn wget
and thus it only reads an empty config file? (the file would then flush
at the end of the python script, magically showing a fully written file)