I figured out that after I try to manually write something into the stderr file, no error message will be appear in the shell.
>>> f = open(2, 'w')
>>> f.write('hello\n')
hello
6
>>> f.close()
>>> raise Exception
>>>
>>>
>>> 1/0
>>>
Why it happens?