Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(27)

Unified Diff: Lib/genericpath.py

Issue 3055: combined patches from http://bugs.python.org/issue3187 (Closed) SVN Base: http://svn.python.org/view/*checkout*/python/branches/py3k/
Patch Set: One more tweak (fold some long lines) Created 1 year, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side by-side-diff with in-line comments
Download patch
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]

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r483