Index: Lib/macpath.py =================================================================== --- Lib/macpath.py (revision 43476) +++ Lib/macpath.py (working copy) @@ -74,7 +74,7 @@ It is always true that root + ext == p.""" i = p.rfind('.') - if i<=p.rfind(':'): + if i<=p.rfind(':')+1: return p, '' else: return p[:i], p[i:] Index: Lib/ntpath.py =================================================================== --- Lib/ntpath.py (revision 43476) +++ Lib/ntpath.py (working copy) @@ -187,7 +187,7 @@ Return (root, ext), either part may be empty.""" i = p.rfind('.') - if i<=max(p.rfind('/'), p.rfind('\\')): + if i<=max(p.rfind('/'), p.rfind('\\'))+1: return p, '' else: return p[:i], p[i:] Index: Lib/posixpath.py =================================================================== --- Lib/posixpath.py (revision 43476) +++ Lib/posixpath.py (working copy) @@ -90,7 +90,7 @@ """Split the extension from a pathname. Extension is everything from the last dot to the end. Returns "(root, ext)", either part may be empty.""" i = p.rfind('.') - if i<=p.rfind('/'): + if i<=p.rfind('/')+1: return p, '' else: return p[:i], p[i:] Index: Lib/test/test_macpath.py =================================================================== --- Lib/test/test_macpath.py (revision 43476) +++ Lib/test/test_macpath.py (working copy) @@ -48,7 +48,7 @@ splitext = macpath.splitext self.assertEquals(splitext(":foo.ext"), (':foo', '.ext')) self.assertEquals(splitext("foo:foo.ext"), ('foo:foo', '.ext')) - self.assertEquals(splitext(".ext"), ('', '.ext')) + self.assertEquals(splitext(".ext"), ('.ext', '')) self.assertEquals(splitext("foo.ext:foo"), ('foo.ext:foo', '')) self.assertEquals(splitext(":foo.ext:"), (':foo.ext:', '')) self.assertEquals(splitext(""), ('', '')) Index: Lib/test/test_ntpath.py =================================================================== --- Lib/test/test_ntpath.py (revision 43476) +++ Lib/test/test_ntpath.py (working copy) @@ -18,7 +18,7 @@ tester('ntpath.splitext("foo.ext")', ('foo', '.ext')) tester('ntpath.splitext("/foo/foo.ext")', ('/foo/foo', '.ext')) -tester('ntpath.splitext(".ext")', ('', '.ext')) +tester('ntpath.splitext(".ext")', ('.ext', '')) tester('ntpath.splitext("\\foo.ext\\foo")', ('\\foo.ext\\foo', '')) tester('ntpath.splitext("foo.ext\\")', ('foo.ext\\', '')) tester('ntpath.splitext("")', ('', '')) Index: Lib/test/test_posixpath.py =================================================================== --- Lib/test/test_posixpath.py (revision 43476) +++ Lib/test/test_posixpath.py (working copy) @@ -46,7 +46,7 @@ def test_splitext(self): self.assertEqual(posixpath.splitext("foo.ext"), ("foo", ".ext")) self.assertEqual(posixpath.splitext("/foo/foo.ext"), ("/foo/foo", ".ext")) - self.assertEqual(posixpath.splitext(".ext"), ("", ".ext")) + self.assertEqual(posixpath.splitext(".ext"), (".ext", "")) self.assertEqual(posixpath.splitext("/foo.ext/foo"), ("/foo.ext/foo", "")) self.assertEqual(posixpath.splitext("foo.ext/"), ("foo.ext/", "")) self.assertEqual(posixpath.splitext(""), ("", ""))