[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory
Manuel Barkhau added the comment: This issue cropped up recently in the black project: https://github.com/psf/black/issues/1631 It appears to me that PR 7666 was closed without being merged. I created https://github.com/python/cpython/pull/21971 before I had found this issue. -- versions: +Python 3.10, Python 3.9 ___ Python tracker <https://bugs.python.org/issue33660> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33660] pathlib.Path.resolve() returns path with double slash when resolving a relative path in root directory
Change by Manuel Barkhau : -- nosy: +mbarkhau nosy_count: 6.0 -> 7.0 pull_requests: +21079 pull_request: https://github.com/python/cpython/pull/21971 ___ Python tracker <https://bugs.python.org/issue33660> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback
Manuel Barkhau added the comment: > If you pass a string, you will get a string, so existing code will continue > to work as before. Somebody might have code that is running against a flat directory and have written their ignore function expecting to get a pathlib.Path, because that's the only case they encountered. This change would break their code and so would an upgrade to 3.9 with the patch that was just merged. -- ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback
Manuel Barkhau added the comment: > For completeness, a similar problem is present also on python < 3.8 Fair point. I'll have a look. -- ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback
Change by Manuel Barkhau : -- pull_requests: +17554 pull_request: https://github.com/python/cpython/pull/18168 ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback
Change by Manuel Barkhau : -- pull_requests: +17509 pull_request: https://github.com/python/cpython/pull/18122 ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback
Manuel Barkhau added the comment: Unless somebody else wants to, I could have a go at an PR to update shutil.py -- ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback
Manuel Barkhau added the comment: Is there anything I can do to help move this forward? -- ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback
Manuel Barkhau added the comment: > This looks like a backward incompatible change in 3.8. Indeed. > Should not copytree convert arguments of the ignore callback to str and list > correspondingly? Well, since any existing code probably expects that behavior (or at least probably works if that is the case), I would be for such a change. I'm not sure what your policy is though. If there is recently written code that assumes the new types, are you OK with that breaking if it is changed back? I guess since it's an undocumented breaking change, it shouldn't be too much of an issue. -- ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback
Change by Manuel Barkhau : -- keywords: +patch pull_requests: +17462 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18069 ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - 3.8 changed argument types of the ignore callback
Change by Manuel Barkhau : -- title: shutil.copytree - ignore callback behaviour change -> shutil.copytree - 3.8 changed argument types of the ignore callback ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39390] shutil.copytree - ignore callback behaviour change
New submission from Manuel Barkhau : In Python 3.8, the types of the parameters to the ignore callable appear to have changed. Previously the `src` parameter was a string and the `names` parameter was a list of strings. Now the `src` parameter appears to be either a `pathlib.Path` or an `os.DirEntry`, while the `names` parameter is a set of strings. I would suggest adding the following to the documentation https://github.com/python/cpython/blob/master/Doc/library/shutil.rst .. versionchanged:: 3.8 The types of arguments to *ignore* have changed. The first argument (the directory being visited) is a func:`os.DirEntry` or a func:`pathlib.Path`; Previously it was a string. The second argument is a set of strings; previously it was a list of strings. -- assignee: docs@python components: Documentation, Library (Lib) messages: 360271 nosy: docs@python, mbarkhau priority: normal severity: normal status: open title: shutil.copytree - ignore callback behaviour change type: behavior versions: Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue39390> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com