diff -r becc0a488189 Lib/tempfile.py --- a/Lib/tempfile.py Fri Oct 25 12:33:59 2013 -0400 +++ b/Lib/tempfile.py Fri Oct 25 18:20:44 2013 +0100 @@ -146,7 +146,7 @@ for dir in dirlist: if dir != _os.curdir: - dir = _os.path.normcase(_os.path.abspath(dir)) + dir = _os.path.abspath(dir) # Try only a few names per directory. for seq in range(100): name = next(namer) diff -r becc0a488189 Lib/test/test_tempfile.py --- a/Lib/test/test_tempfile.py Fri Oct 25 12:33:59 2013 -0400 +++ b/Lib/test/test_tempfile.py Fri Oct 25 18:20:44 2013 +0100 @@ -478,6 +478,20 @@ self.assertTrue(a is b) + def test_case_sensitive(self): + # gettempdir should not flatten its case + # even on a case-insensitive file system + case_sensitive_tempdir = tempfile.mkdtemp("-Temp") + _tempdir, tempfile.tempdir = tempfile.tempdir, None + try: + with support.EnvironmentVarGuard() as env: + # Fake the first env var which is checked as a candidate + env["TMPDIR"] = case_sensitive_tempdir + self.assertEqual(tempfile.gettempdir(), case_sensitive_tempdir) + finally: + tempfile.tempdir = _tempdir + support.rmdir(case_sensitive_tempdir) + class TestMkstemp(BaseTestCase): """Test mkstemp().""" diff -r becc0a488189 Lib/test/test_zipimport_support.py --- a/Lib/test/test_zipimport_support.py Fri Oct 25 12:33:59 2013 -0400 +++ b/Lib/test/test_zipimport_support.py Fri Oct 25 18:20:44 2013 +0100 @@ -227,13 +227,15 @@ p = spawn_python(script_name) p.stdin.write(b'l\n') data = kill_python(p) - self.assertIn(script_name.encode('utf-8'), data) + # bdb/pdb applies normcase to its filename before displaying + self.assertIn(os.path.normcase(script_name.encode('utf-8')), data) zip_name, run_name = make_zip_script(d, "test_zip", script_name, '__main__.py') p = spawn_python(zip_name) p.stdin.write(b'l\n') data = kill_python(p) - self.assertIn(run_name.encode('utf-8'), data) + # bdb/pdb applies normcase to its filename before displaying + self.assertIn(os.path.normcase(run_name.encode('utf-8')), data) def test_main():