Here's a simple Python script:

import subprocess
with open('hi.txt', 'w') as f:
  subprocess.Popen(['echo', 'Hello'], stdout=f).wait()

Here's what it does:

$ python2.7
$ cat hi.txt

And here's what happens if you try to use the trace module to trace the execution:

$ python2.7 -m trace --trace
(lots of trace output omitted)

So far so good, but take a look at hi.txt:

$ cat hi.txt                             _dup2(errwrite, 2)
 --- modulename: subprocess, funcname: _dup2                                 if a == b:                                 elif a is not None:
... 154 lines of unexpected trace output omitted ...         try:             func(fullname, *argrest)

The tracing hook installed by survives the os.fork() and interferes with subprocess output redirection. Now you know.

Imagine what this does to scripts that execute shell commands and try to parse their output.

Who wants to file a bug and/or provide a patch? I'm afraid I don't have enough round tuits...