osutils.splitpath lose info about root directory
Bug #164814 reported by
Alexander Belchenko
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
osutils.splitpath has serious defect: it throw away information about root directory. So consequent joinpath operation will produce is not exactly the same path as was passed to splitpath.
Examples:
In [15]: osutils.
Out[15]: ['root', 'path']
In [16]: osutils.
Out[16]: 'root/path'
In [17]: osutils.
Out[17]: ['C:', 'root', 'path']
In [18]: osutils.
Out[18]: 'C:root/path'
Standard os.path.split does the job right:
In [19]: os.path.
Out[19]: ('/', 'root')
In [20]: os.path.
Out[20]: ('C:/', 'root')
Changed in bzr: | |
status: | Triaged → Confirmed |
tags: | added: check-for-breezy |
To post a comment you must log in.
I'm not sure what the specific uses for splitpath are, as I've always used osutils. pathsplit( ).
However, I think they are all meant to be used only on relative paths, which should therefore not *have* a root.