Issue 25409: fnmatch.fnmatch normalizes slashes/backslashes on Windows (original) (raw)

Issue25409

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Mariatta, The Compiler, docs@python, eric.araujo, ezio.melotti, georg.brandl, paul.moore, r.david.murray, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: easy

Created on 2015-10-15 06:04 by The Compiler, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1535 merged cheryl.sabella,2017-05-10 14:42
PR 2065 merged Mariatta,2017-06-10 04:42
PR 2066 merged Mariatta,2017-06-10 04:44
PR 2067 merged Mariatta,2017-06-10 04:50
Messages (9)
msg253030 - (view) Author: Florian Bruhin (The Compiler) * Date: 2015-10-15 06:04
On Windows 8: >>> fnmatch.fnmatch(r'foo\bar', 'foo/bar') True >>> fnmatch.fnmatchcase(r'foo\bar', 'foo/bar') False This is due to fnmatch calling os.path.normpath on the arguments (to get the case-sensitivity of the filesystem), which on Windows *also* happens to normalize / to \. It's probably a bad idea to change the behaviour now, but I think at least this should be clarified in the docs.
msg253040 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-10-15 10:56
I think the existing behavior is the desirable behavior, but in any case as you say it is too late to change it. The docs should indeed be clarified by changing the wording to indicate that fnmatch calls normcase but fnmatchcase does not, with a link to normcase (which in turn documents the windows behavior).
msg293423 - (view) Author: Florian Bruhin (The Compiler) * Date: 2017-05-10 14:57
https://github.com/python/cpython/pull/1535 seems to be the correct PR, not 1634.
msg293427 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-05-10 15:46
Yes, PR 1535 is indeed linked to this issue, if you're reading it from the bug tracker. The pull request number you see from the notification email (+1634) refers to the pull_request item in the bug tracker (https://bugs.python.org/pull_request1634). This number is different than the pull request # on GitHub. Hope this clarifies it :) See also discussions about it: https://github.com/python/core-workflow/issues/35 http://psf.upfronthosting.co.za/roundup/meta/issue624 (I was confused about it too)
msg295609 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-06-10 04:42
New changeset e5f6e86c48c7b2eb9e1d6a0e72867b4d8b4720f3 by Mariatta (csabella) in branch 'master': bpo-25409: Clarify fnmatch and fnmatchcase documentation (GH-1535) https://github.com/python/cpython/commit/e5f6e86c48c7b2eb9e1d6a0e72867b4d8b4720f3
msg295638 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-06-10 14:25
New changeset 76eabd3a21dc578de6093d45dd8d69a5ec4b9afe by Mariatta in branch '3.6': bpo-25409: Clarify fnmatch and fnmatchcase documentation (GH-1535) (GH-2065) https://github.com/python/cpython/commit/76eabd3a21dc578de6093d45dd8d69a5ec4b9afe
msg295639 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-06-10 14:26
New changeset 656f232131e7a49800662119c7f9b8078729e697 by Mariatta in branch '3.5': bpo-25409: Clarify fnmatch and fnmatchcase documentation (GH-1535) (GH-2066) https://github.com/python/cpython/commit/656f232131e7a49800662119c7f9b8078729e697
msg295640 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-06-10 14:26
New changeset 9660a7e4bbc3932846fcde0e31856b5b3908b834 by Mariatta in branch '2.7': bpo-25409: Clarify fnmatch and fnmatchcase documentation (GH-1535) (GH-2067) https://github.com/python/cpython/commit/9660a7e4bbc3932846fcde0e31856b5b3908b834
msg295641 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2017-06-10 14:27
This has been fixed, and backported to 2.7, 3.5, and 3.6. Thanks :)
History
Date User Action Args
2022-04-11 14:58:22 admin set github: 69595
2017-06-10 14:27:45 Mariatta set status: open -> closedresolution: fixedmessages: + stage: patch review -> resolved
2017-06-10 14:26:41 Mariatta set messages: +
2017-06-10 14:26:11 Mariatta set messages: +
2017-06-10 14:25:35 Mariatta set messages: +
2017-06-10 04:50:08 Mariatta set pull_requests: + <pull%5Frequest2131>
2017-06-10 04:44:43 Mariatta set pull_requests: + <pull%5Frequest2130>
2017-06-10 04:42:54 Mariatta set pull_requests: + <pull%5Frequest2129>
2017-06-10 04:42:13 Mariatta set messages: +
2017-05-10 15:46:35 Mariatta set versions: + Python 3.7, - Python 3.4nosy: + Mariattamessages: + stage: needs patch -> patch review
2017-05-10 14:57:06 The Compiler set messages: +
2017-05-10 14:42:58 cheryl.sabella set pull_requests: + <pull%5Frequest1634>
2016-01-01 04:12:53 ezio.melotti set keywords: + easyassignee: docs@pythoncomponents: + Documentation, Windowsnosy: + docs@python
2015-10-15 10:56:21 r.david.murray set versions: + Python 3.4, Python 3.6nosy: + r.david.murraymessages: + stage: needs patch
2015-10-15 06:04:51 The Compiler create