title: How can I get the correct case when calling Python's os.getcwd()?
body: <p>When I call os.getcwd() on my Mac under OS X 10.6.4 from my home directory, the path is converted to lowercase. I get </p>
  
  <p>/users/myusername</p>
  
  <p>instead of</p>
  
  <p>/Users/myusername</p>
  
  <p>On another Mac I get the correct uppercase string. How can I configure this? Is there a (hidden) Python setting?</p>
  
  <p>Reason for asking:
  On OS X all user directories are in "/Users". This is always uppercase. When using Mercurial, it gets sometimes confused with this strange and incorrect normalization of my current directory.</p>
  
  <p>In reply to the suggested solutions:</p>
  
  <p>(1)
  DiskUtil says that my drive has a format of "Mac OS Extended (Journaled)". I bought my computer some month ago and it's still the original drive, never reformatted.</p>
  
  <p>(2) Another python console session log:</p>
  
  <p>$>>> os.system('pwd')</p>
  
  <p>/Users/klaas</p>
  
  <p>0</p>
  
  <p>$>>> os.getcwd()"</p>
  
  <p>'/users/klaas'</p>
  
  <p>$>>> os.path.normcase('/Users/klaas')</p>
  
  <p>'/Users/klaas'</p>
  
  <p>$>>> os.chdir('/UsErS/klaas')</p>
  
  <p>$>>> os.getcwd()</p>
  
  <p>'/users/klaas'</p>
  
  <p>$>>> os.chdir('/UsErS/klaas')</p>
  
  <p>$>>> os.getcwd()</p>
  
  <p>'/users/klaas'</p>
  
  <p><b>Update 2:</b></p>
  
  <p>Thanks for all the replies. I created a test case in Objective-C and it has the same lowercase folder name:</p>
  
  <pre><code>NSFileManager *filemgr;
  NSString *currentpath;
  
  filemgr = [NSFileManager defaultManager];
  
  currentpath = [filemgr currentDirectoryPath];
  
  NSLog (@"Current directory is %@", currentpath);
  </code></pre>