This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add support for __fspath__ to fnmatch.fnmatchase and filter
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: adelfino
Priority: normal Keywords: patch

Created on 2018-12-03 22:43 by adelfino, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10881 closed adelfino, 2018-12-03 22:45
Messages (2)
msg330992 - (view) Author: Andrés Delfino (adelfino) * (Python triager) Date: 2018-12-03 22:43
Both fnmatch.fnmatchase and fnmatch.filter (in Unix) do not support path-like objects.

This is inconvenient, for example, when taking advantage of os.scandir and working with os.DirEntry objets.

Also, fnmatch.filter in Windows does support path-like objects, since it uses os.path.normcase (which works with path-like objects), so the change for Unix would add consistency.

I propose for both functions to accept path-like objects, and in the case of fnmatch.filter, to return the path-like object if it matches the pattern (as it does now for Windows).
msg331099 - (view) Author: Andrés Delfino (adelfino) * (Python triager) Date: 2018-12-05 11:23
Closing, as __fspath__ returns paths and fnmatchcase/filter deals with filenames.
History
Date User Action Args
2022-04-11 14:59:08adminsetgithub: 79577
2018-12-05 11:23:35adelfinosetstatus: open -> closed
resolution: rejected
messages: + msg331099

stage: patch review -> resolved
2018-12-03 22:45:06adelfinosetkeywords: + patch
stage: patch review
pull_requests: + pull_request10121
2018-12-03 22:43:24adelfinocreate