This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ntpath.splitdrive('//') -> IndexError
Type: Stage: resolved
Components: Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: arigo, eryksun, python-dev
Priority: normal Keywords:

Created on 2014-08-31 10:14 by arigo, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (4)
msg226163 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2014-08-31 10:14
Calling Python 2.7's new version of ntpath.splitdrive() with argument either '//' or r'\\' results in an IndexError: string index out of range.
msg226170 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2014-08-31 10:54
For completeness:

   Python 2.7.6: ntpath.splitdrive('//') => ('', '//')
   Python 2.7.8: ntpath.splitdrive('//') => IndexError
msg226178 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2014-08-31 13:31
Line 116 should use normp[2:3] instead of normp[2]. 

http://hg.python.org/cpython/file/ee879c0ffa11/Lib/ntpath.py#l92
msg226179 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-08-31 13:34
New changeset 446d4dfcc220 by Benjamin Peterson in branch '2.7':
don't index outside of the path (closes #22312)
http://hg.python.org/cpython/rev/446d4dfcc220
History
Date User Action Args
2022-04-11 14:58:07adminsetgithub: 66508
2014-08-31 13:34:24python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg226179

resolution: fixed
stage: resolved
2014-08-31 13:31:10eryksunsetnosy: + eryksun
messages: + msg226178
2014-08-31 10:54:46arigosetmessages: + msg226170
2014-08-31 10:14:02arigocreate