title: Python: OSError: [Errno 2] No such file or directory: ''
body: <p>I have a 100 lines, 3 years old python scraper that now bug. Starting lines are:</p>
  
  <pre><code>import urllib, re, os, sys, time    # line 1: import modules
  os.chdir(os.path.dirname(sys.argv[0])) # line 2: all works in script's folder &gt; relative address
  # (rest of my script here!)
  </code></pre>
  
  <p>When run, </p>
  
  <pre><code>$cd /my/folder/
  $python script.py
  </code></pre>
  
  <p>I receive the error:</p>
  
  <pre><code>python script.py 
  Traceback (most recent call last):
    File "script.py", line 2, in &lt;module&gt;
      os.chdir(os.path.dirname(sys.argv[0]))
  OSError: [Errno 2] No such file or directory: ''
  </code></pre>
  
  <p><strong>How should I read this error and what to do ?</strong></p>