[issue37130] pathlib.Path.with_name() handles '.' and '..' inconsistently

Brett Cannon report at bugs.python.org
Thu Jun 13 15:15:00 EDT 2019


Brett Cannon <brett at python.org> added the comment:

@Antoine: Basically Path.with_name() fails under '.' but works with '..' although with a somewhat odd result. And then after that is the fact that Path('.').name is the empty string but for Path('..').name it's '..' (which is what causes Path('.').with_name() to fail).

----------
title: pathlib does not handle '..' directory -> pathlib.Path.with_name() handles '.' and '..' inconsistently

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37130>
_______________________________________


More information about the Python-bugs-list mailing list