| Index: Lib/genericpath.py |
| =================================================================== |
| --- Lib/genericpath.py (revision 66736) |
| +++ Lib/genericpath.py (working copy) |
| @@ -87,6 +87,7 @@ |
| Extension is everything from the last dot to the end, ignoring |
| leading dots. Returns "(root, ext)"; ext may be empty.""" |
| + # NOTE: This code must work for text and bytes strings. |
| sepIndex = p.rfind(sep) |
| if altsep: |
| @@ -98,8 +99,8 @@ |
| # skip all leading dots |
| filenameIndex = sepIndex + 1 |
| while filenameIndex < dotIndex: |
| - if p[filenameIndex] != extsep: |
| + if p[filenameIndex:filenameIndex+1] != extsep: |
| return p[:dotIndex], p[dotIndex:] |
| filenameIndex += 1 |
| - return p, '' |
| + return p, p[:0] |