title: Python: Trying to restart script not working
body: <p>Tried to restart my python script within itself.
  Python 2.7.11</p>
  
  <pre><code>#!/usr/bin/python
  # -*- coding: utf-8 -*-
  import os
  import sys
  os.execv(__file__, sys.argv)
  sys.exit()
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>Traceback (most recent call last):
      File "...\foo.py", line 3, in &lt;module&gt;
          os.execv(__file__, sys.argv)
  OSError: [Errno 8] Exec format error
  </code></pre>
  
  <p>Another code:</p>
  
  <pre><code>#!/usr/bin/python
  # -*- coding: utf-8 -*-
  import os
  import sys
  os.execv(sys.executable, [sys.executable] + sys.argv)
  sys.exit()
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>C:\...\python.exe: can't open file 'C:\...\Math': [Errno 2] No such file or directory
  </code></pre>
  
  <p>The file's name is foo.py - it's in a folder name 'Math Project'</p>
  
  <p>Codepage: 852, if necessary.</p>