title: Why does python exception behavior depend on argv[0]?
body: <p>I'm working on a linux system where unhandled python exceptions cause scripts to hang rather than exit with a stack trace.  I realized that it seems to depend on the path of the script.  For example, this works as expected</p>
  
  <pre><code>$ echo 'raise Exception("This is a test exception.")' &gt; test-exception.py
  $ python test-exception.py
  Traceback (most recent call last):
    File "test-exception.py", line 1, in &lt;module&gt;
      raise Exception("This is a test exception.")
  Exception: This is a test exception.
  </code></pre>
  
  <p>But this hangs indefinitely</p>
  
  <pre><code>$ python $PWD/test-exception.py
  </code></pre>
  
  <p>If I send the process SIGINT by pressing CTRL-C, then the stack trace prints as usual and the program returns.</p>
  
  <p>I can't replicate this behavior on various other machines, so I suspect the machine is fubar and some system call is hanging. Here are the last few lines of strace output</p>
  
  <pre><code>$ strace python $PWD/test-exception.py
  [... snip]
  munmap(0x7f33193d8000, 266240)          = 0
  brk(0x24a9000)                          = 0x24a9000
  brk(0x24e1000)                          = 0x24e1000
  close(4)                                = 0
  socket(PF_FILE, SOCK_STREAM, 0)         = 4
  connect(4, {sa_family=AF_FILE, path="/var/run/abrt/abrt.socket"}, 27
  </code></pre>
  
  <p>What's going on? Why does argv[0] change exception handling? </p>