title: python TypeError: must be encoded string without NULL bytes, not str
body: <p>Trying to get familiar with python's standard library and doing some mucking around with it on my Windows machine.  Using python 2.7 I have the following little script which is intended to look in a directory and rename all of the files therein after removing numerals from the file name.  I'm getting a typeerror that says "must be encoded string without NULL bytes, not str"</p>
  
  <p>it calls out lines 5 and 18, <strong>noted below</strong>, where im using os.path.exists.</p>
  
  <p>Any help would be greatly appreciated!</p>
  
  <pre><code>    import os, re, string, glob
  
      path = os.path.normpath('C:\Users\me\Photo Projects\Project Name\Project Photos\Modified\0-PyTest')
  
  ln5:if os.path.exists(path):
          print "path exists at " + path
          for file in glob.glob(os.path.join(path, '*.jpg')):
              new_path = os.path.join(os.path.dirname(file), re.sub('\d', '', os.path.basename(file)))
  line18:     if not os.path.exists(new_path):
                  os.rename(file, new_path)
  </code></pre>