[New-bugs-announce] [issue35396] Add support for __fspath__ to fnmatch.fnmatchase and filter

Andrés Delfino report at bugs.python.org
Mon Dec 3 17:43:24 EST 2018


New submission from Andrés Delfino <adelfino at gmail.com>:

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).

----------
components: Library (Lib)
messages: 330992
nosy: adelfino
priority: normal
severity: normal
status: open
title: Add support for __fspath__ to fnmatch.fnmatchase and filter
type: enhancement
versions: Python 3.8

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


More information about the New-bugs-announce mailing list