[issue37130] pathlib does not handle '..' directory

2019-06-12 Thread N.P. Khelili
N.P. Khelili added the comment: @Brett: Honestly I don't think it is the best way. But fact is: nono@ACER ~ % cd / nono@ACER / % python Python 3.7.3 (default, Mar 26 2019, 21:43:19) [GCC 8.2.1 20181127] on linux Type "help", "copyright", "credits" or

[issue37130] pathlib does not handle '..' directory

2019-06-12 Thread N.P. Khelili
N.P. Khelili added the comment: After digging the question,I'd rather go for a minimal change. - setting .name to '' for '..' - let it be known in the doc - special-casing Path('..').stem (to keep the old behaviour) - update tests More could be done, but I don't feel like rewriting too much

[issue37130] pathlib does not handle '..' directory

2019-06-12 Thread N.P. Khelili
Change by N.P. Khelili : -- keywords: +patch pull_requests: +13887 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/14022 ___ Python tracker <https://bugs.python.org/issu

[issue37130] pathlib does not handle '..' directory

2019-06-10 Thread N.P. Khelili
N.P. Khelili added the comment: First, there is no real special case about the '.' path. The parse_args() method simlply removes then during __new__() (around line 80) as they are not needed. Double dots having to be kept, are later considered valid by the name @property

[issue37199] Test suite fails when Ipv6 is unavailable

2019-06-07 Thread N.P. Khelili
New submission from N.P. Khelili : The test suite does not handle an OS that does not have IPv6. When Linux kernel is started with argument: ipv6.disable=1 The test suite fails. ( See attached file ) 5 tests failed: test_asyncio test_imaplib test_importlib test_socket test_zipapp

[issue37130] pathlib.with_name() doesn't like unnamed files.

2019-06-05 Thread N.P. Khelili
N.P. Khelili added the comment: The idea in my last post was quite bad, setting name to None breaks a lot of functions that expect name to be a string. Path('.').parent and Path('..').parent both return '.'. Even if it is not stupid (regarding them as special dirs pointing to somewhere else

[issue37130] pathlib.with_name() doesn't like unnamed files.

2019-06-04 Thread N.P. Khelili
N.P. Khelili added the comment: in the definition of the name property https://github.com/python/cpython/blob/9ab2fb1c68a75115da92d51b8c40b74f60f88561/Lib/pathlib.py#L792 : if len(parts) == (1 if (self._drv or self._root) else 0): return '' could also become if self.parent == self

[issue37130] pathlib.with_name() doesn't like unnamed files.

2019-06-01 Thread N.P. Khelili
New submission from N.P. Khelili : Hi guys! I'm new to python and working on my first real project with it I'm sorry if it's not the right place for posting this. I noticed that that pathlib.with_name() method does not accept to give a name to a path that does not already have one