Reducer needs to take input from stdin, and it should keep reading until the stream closes.
Expected input is one file path per line. Reading can be done simply like this:
for line in sys.stdin:
...
When trying out the script on it's own in the terminal, use ctrl + d to close the stream (sends EOF character).