[issue11344] Add os.path.splitpath(path) function

2015-04-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I thought that splitpath() could be used in implementations of realpath(), relpath(), commonpath(), and in user code. But looks as realpath(), relpath() and commonpath() should use specialized inlined versions for efficiency, and user code can use more

[issue11344] Add os.path.splitpath(path) function

2015-03-31 Thread Paul Moore
Paul Moore added the comment: Assuming new code should be using pathlib, I agree this should probably be closed now as obsolete. One proviso - pathlib objects don't take a bytestring path in the constructor. If there's a need for a low-level splitpath taking bytes objects, there may still be

[issue11344] Add os.path.splitpath(path) function

2015-03-30 Thread Martin Panter
Martin Panter added the comment: I think my use cases of splitpath() could be fulfilled by using Path.parts, Path.anchor, Path.relative_to(), etc. I am a bit sad that this never made it in, but I agree it is redundant with pathlib, and the issue should probably be closed. --

[issue11344] Add os.path.splitpath(path) function

2015-03-19 Thread Éric Araujo
Éric Araujo added the comment: pathlib is in the stdlib now (see previous comments), maybe this should be closed as obsolete. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___

[issue11344] Add os.path.splitpath(path) function

2014-07-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Updated patch. Added private general implementation in genericpath and specialized implementations are now tested to return the same result as general implementation. -- versions: +Python 3.5 -Python 3.4 Added file:

[issue11344] Add os.path.splitpath(path) function

2014-07-13 Thread Brian Curtin
Changes by Brian Curtin br...@python.org: -- nosy: -brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___ ___ Python-bugs-list

[issue11344] Add os.path.splitpath(path) function

2013-11-18 Thread Martin Panter
Martin Panter added the comment: The ntpath.splitpath() version is easy to get lost in. It would probably help if you spelt out all the single-letter variable names, and explained that tri-state root/separator = None/True/False flag. Maybe there is a less convoluted way to write it too, I

[issue11344] Add os.path.splitpath(path) function

2013-11-18 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added examples and Martin's notes to the documentation. ntpath implementation rewrote with regular expressions (it is now shorter and perhaps more clear). -- Added file: http://bugs.python.org/file32691/ospath_splitpath_2.patch

[issue11344] Add os.path.splitpath(path) function

2013-11-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The pathlib module is not in the stdlib yet, while a patch for splitpath() waits for review almost a year. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344

[issue11344] Add os.path.splitpath(path) function

2013-09-28 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' g.rod...@gmail.com: -- nosy: +giampaolo.rodola ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___ ___

[issue11344] Add os.path.splitpath(path) function

2013-09-14 Thread Martin Panter
Changes by Martin Panter vadmium...@gmail.com: -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___ ___ Python-bugs-list

[issue11344] Add os.path.splitpath(path) function

2012-12-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please review. This function is very important for many applications (and it hard to get right). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344

[issue11344] Add os.path.splitpath(path) function

2012-12-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Please review. This function is very important for many applications (and it hard to get right). The pathlib module (PEP 428) has such functionality built-in. -- ___ Python tracker rep...@bugs.python.org

[issue11344] Add os.path.splitpath(path) function

2012-12-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___ ___

[issue11344] Add os.path.splitpath(path) function

2012-12-03 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___

[issue11344] Add os.path.splitpath(path) function

2012-12-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: splitpath() should be equivalent to followed code (but be non-recursive and more effective): def splitpath(path): head, tail = split(path) if head == path: return [head] else: return splitpath(head) + [tail] -- nosy:

[issue11344] Add os.path.splitpath(path) function

2012-12-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- versions: +Python 3.4 -Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___ ___

[issue11344] Add os.path.splitpath(path) function

2012-12-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The proposed patch adds effective implementations of mentioned above algorithm. splitpath() can be used for consecutive implementation of relpath() and commonpath(). -- stage: - patch review ___ Python tracker

[issue11344] Add os.path.splitpath(path) function

2012-12-02 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: Added file: http://bugs.python.org/file28187/ospath_splitpath.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___

[issue11344] Add os.path.splitpath(path) function

2011-07-13 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: I’m not sure this is correct for POSIX: splitpath('/gparent/parent/') returns ['gparent', 'parent'] / is a real directory, it should be the ultimate parent of any path IIUC. On a related note, using “parent” for the leaf file looks strange to

[issue11344] Add os.path.splitpath(path) function

2011-04-30 Thread Éric Araujo
Éric Araujo mer...@netwok.org added the comment: To clarify one point: Python does not try to mimic the shell, but the os module exposes system calls as they are. (Unrelated remark: pkgutil.get_data can replace a lot of uses of dirname(dirname(__file__))) -- nosy: +eric.araujo

[issue11344] Add os.path.splitpath(path) function

2011-04-29 Thread blokeley
blokeley bloke...@gmail.com added the comment: The unit tests on the cpython tip revision fail even before applying my patches and I'm afraid haven't got the time to debug the threading module or existing unit tests. The traceback is: C:\workspace\cpython\Lib\test C:\Python32\python.exe

[issue11344] Add os.path.splitpath(path) function

2011-04-29 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Did you try a make distclean/configure/make? _thread.info is a new attribute introduced by a relatively recent patch. -- ___ Python tracker rep...@bugs.python.org

[issue11344] Add os.path.splitpath(path) function

2011-04-29 Thread blokeley
blokeley bloke...@gmail.com added the comment: My runtime came from the Python32 Windows installer and I don't have a C compiler on this machine. Therefore I updated to the 3.2 branch in hg and worked on that. This patch is pretty simple so should work on 3.3 without modifications. I have

[issue11344] Add os.path.splitpath(path) function

2011-04-29 Thread Brian Curtin
Changes by Brian Curtin br...@python.org: -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___ ___ Python-bugs-list

[issue11344] Add os.path.splitpath(path) function

2011-04-29 Thread Santoso Wijaya
Changes by Santoso Wijaya santoso.wij...@gmail.com: -- nosy: +santa4nt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11344 ___ ___

[issue11344] Add os.path.splitpath(path) function

2011-03-08 Thread blokeley
blokeley bloke...@gmail.com added the comment: I started writing the patch against py2.7 but realised that 2.7 could be the last in the 2.x series. I'll write the patch against default tip. -- title: Add height argument to os.path.dirname() - Add os.path.splitpath(path) function