wikiextractor icon indicating copy to clipboard operation
wikiextractor copied to clipboard

Open output files after forking

Open prokotg opened this issue 5 years ago • 2 comments

Fixes #233 Opening output files before forking makes the script crash on Windows . I did not test the influence of this PR on other systems and python versions.

prokotg avatar Dec 15 '20 11:12 prokotg

Watch out: the second argument to reduce_process() might be sys.stdout and not an OutputSplitter.

if out_file == '-':
    output = sys.stdout

Then it won't have method open_file(), that you call in reduce+process().

attardi avatar Dec 16 '20 17:12 attardi

fixed

prokotg avatar Dec 16 '20 21:12 prokotg