title: In Python, how do you identify a directory where the name includes a period?
body: <p>Under Windows, suppose you have the following directory:</p>
  
  <pre><code>r:\glew-1.10.0
  </code></pre>
  
  <p>What Python method can be used to reliably identify that this is a directory?</p>
  
  <pre><code>os.path.isdir("r:\\glew-1.10.0")  # returns false
  os.path.isfile("r:\\glew-1.10.0") # returns true
  
  mode = os.stat("r:\\glew-1.10.0").st_mode
  stat.S_ISDIR(mode)       # raises a WindowsError - the system cannot find the file
  </code></pre>
  
  <p>It seems clear that the presence of a period in the directory name is causing the problem with these functions, but I can't find any alternatives.</p>