Repository navigation
Conversation
Wauplin
reviewed
Jun 29, 2026
Wauplin
approved these changes
Jun 29, 2026
Wauplin
left a comment
Collaborator
There was a problem hiding this comment.
That's a TIL for me, good catch 🤗
Wauplin
reviewed
Jun 29, 2026
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Contributor
Author
|
Thanks for the quick review and merge! Learned the fnmatch/normcase quirk myself digging into this 🙂 |
Contributor
|
This PR has been shipped as part of the v1.22.0 release. |
CalamitousFelicitousness
added a commit
to vladmandic/sdnext
that referenced
this pull request
Jul 8, 2026
diffusers pipeline downloads build subfolder config.json allow-patterns with os.path.join, and huggingface_hub>=1.22 matches patterns with fnmatchcase which does not normalize path separators (huggingface/huggingface_hub#4435). On windows the resulting backslash patterns match nothing, so per-component config.json files are never downloaded and the incomplete snapshot still passes the diffusers cache-completeness check, failing every subsequent load with "no file named config.json". Prefetch component configs with forward-slash patterns before pipeline load. This covers all model families and also repairs snapshots already broken by the bug on the next load attempt. No-op on linux, in offline mode, and for local folder or single-file models.
liutyi
pushed a commit
to liutyi/sdnext
that referenced
this pull request
Jul 8, 2026
diffusers pipeline downloads build subfolder config.json allow-patterns with os.path.join, and huggingface_hub>=1.22 matches patterns with fnmatchcase which does not normalize path separators (huggingface/huggingface_hub#4435). On windows the resulting backslash patterns match nothing, so per-component config.json files are never downloaded and the incomplete snapshot still passes the diffusers cache-completeness check, failing every subsequent load with "no file named config.json". Prefetch component configs with forward-slash patterns before pipeline load. This covers all model families and also repairs snapshots already broken by the bug on the next load attempt. No-op on linux, in offline mode, and for local folder or single-file models.
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4434.
filter_repo_objectsmatchedallow_patterns/ignore_patternswithfnmatch.fnmatch, which appliesos.path.normcase— so matching was case-insensitive on Windows but case-sensitive on Linux/macOS. Since these patterns are matched against case-sensitive Hub paths, the same call could return different files depending on the client OS (e.g.snapshot_download(..., allow_patterns=["*.PDF"])).This switches to
fnmatch.fnmatchcase, which performs the same wildcard matching without OS-dependent case normalization, making behavior consistent on all platforms. Adds a regression test and fixes an inconsistent docstring example.Note: this is a behavior change on Windows (matching becomes case-sensitive). I believe consistent, case-sensitive matching is the correct behavior for Hub paths, but happy to gate it behind an option instead if you'd prefer.
Note
Medium Risk
Changes cross-platform filtering behavior for downloads and repo uploads on Windows; Linux/macOS users with case-mismatched patterns may see fewer matches than before on those OSes only if they relied on accidental case-insensitivity.
Overview
filter_repo_objectsnow matchesallow_patternsandignore_patternswithfnmatch.fnmatchcaseinstead offnmatch, so wildcard filtering is case-sensitive on every platform (aligned with case-sensitive Hub paths). On Windows this is a behavior change: patterns like*.PDFno longer matchfile.pdf.Docs and the path-filtering example are updated to describe case-sensitive matching. A regression test covers allow/ignore case sensitivity (issue #4434).
Reviewed by Cursor Bugbot for commit 46ba478. Bugbot is set up for automated code reviews on this repo. Configure here.