Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-wcmatch for openSUSE:Factory checked in at 2026-08-22 21:36:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-wcmatch (Old) and /work/SRC/openSUSE:Factory/.python-wcmatch.new.1258 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-wcmatch" Sat Aug 22 21:36:44 2026 rev:10 rq:1373085 version:11.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-wcmatch/python-wcmatch.changes 2026-07-20 10:01:17.380066732 +0200 +++ /work/SRC/openSUSE:Factory/.python-wcmatch.new.1258/python-wcmatch.changes 2026-08-22 21:38:50.739019688 +0200 @@ -1,0 +2,13 @@ +Sat Aug 22 14:11:04 UTC 2026 - Dirk Müller <[email protected]> + +- update to 11.0.1: + * **DOCS**: Provide information in documentation that discloses + information about what should or should not be + * expected from Wildcard Match in regards to security, and + provide general information to allow users to make good + * decisions. + * **FIX**: Fix an issue where in some cases dot handling was + not correct within an extended glob pattern when + * `EXTGLOB`/`EXTMATCH` was enabled. + +------------------------------------------------------------------- Old: ---- wcmatch-11.0.tar.gz New: ---- wcmatch-11.0.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-wcmatch.spec ++++++ --- /var/tmp/diff_new_pack.y1Jv7a/_old 2026-08-22 21:38:51.393043114 +0200 +++ /var/tmp/diff_new_pack.y1Jv7a/_new 2026-08-22 21:38:51.395043186 +0200 @@ -19,7 +19,7 @@ %{?sle15_python_module_pythons} %{?python_enable_dependency_generator} Name: python-wcmatch -Version: 11.0 +Version: 11.0.1 Release: 0 Summary: Wildcard/glob file name matcher License: MIT ++++++ wcmatch-11.0.tar.gz -> wcmatch-11.0.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/PKG-INFO new/wcmatch-11.0.1/PKG-INFO --- old/wcmatch-11.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ -Metadata-Version: 2.4 +Metadata-Version: 2.5 Name: wcmatch -Version: 11.0 +Version: 11.0.1 Summary: Wildcard/glob file name matcher. Project-URL: Homepage, https://github.com/facelessuser/wcmatch Author-email: Isaac Muse <[email protected]> @@ -32,8 +32,30 @@ [![License][license-image-mit]][license-link] # Wildcard Match +> [!warning] +> **Security Considerations** +> +> Wildcard Match translates the more simple, path-centric syntax of glob patterns to regular expression for the purpose +> of iterating and matching file systems. +> +> Regular expression engines like those in JavaScript, Python, Java, etc. choose compatibility and expressiveness over +> guaranteed performance, accepting the risk of catastrophic backtracking when patterns contain nested quantifiers or +> overlapping alternations. +> +> ReDoS (regular expression Denial of Service) cases are those that specifically target the areas where a regular +> expression engine does not guarantee optimal performance. +> +> Because Wildcard Match builds its matching upon the Python regular expression engine, it can take advantage of the +> engine's power, but it is also susceptible the engine's weaknesses. +> +> Learn more [here](https://github.com/facelessuser/wcmatch/blob/main/docs/src/markdown/index.md#security-considerations), +> and be thoughtful about what you provide to this library in production systems. + ## Overview +Wildcard Match translates the more simple, path-centric syntax of glob patterns to regular expression for the purpose of +iterating and matching file systems. + Wildcard Match provides an enhanced `fnmatch`, `glob`, and `pathlib` library in order to provide file matching and globbing that more closely follows the features found in Bash. In some ways these libraries are similar to Python's builtin libraries as they provide a similar interface to match, filter, and glob the file system. But they also include diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/README.md new/wcmatch-11.0.1/README.md --- old/wcmatch-11.0/README.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/README.md 2020-02-02 01:00:00.000000000 +0100 @@ -6,8 +6,30 @@ [![License][license-image-mit]][license-link] # Wildcard Match +> [!warning] +> **Security Considerations** +> +> Wildcard Match translates the more simple, path-centric syntax of glob patterns to regular expression for the purpose +> of iterating and matching file systems. +> +> Regular expression engines like those in JavaScript, Python, Java, etc. choose compatibility and expressiveness over +> guaranteed performance, accepting the risk of catastrophic backtracking when patterns contain nested quantifiers or +> overlapping alternations. +> +> ReDoS (regular expression Denial of Service) cases are those that specifically target the areas where a regular +> expression engine does not guarantee optimal performance. +> +> Because Wildcard Match builds its matching upon the Python regular expression engine, it can take advantage of the +> engine's power, but it is also susceptible the engine's weaknesses. +> +> Learn more [here](https://github.com/facelessuser/wcmatch/blob/main/docs/src/markdown/index.md#security-considerations), +> and be thoughtful about what you provide to this library in production systems. + ## Overview +Wildcard Match translates the more simple, path-centric syntax of glob patterns to regular expression for the purpose of +iterating and matching file systems. + Wildcard Match provides an enhanced `fnmatch`, `glob`, and `pathlib` library in order to provide file matching and globbing that more closely follows the features found in Bash. In some ways these libraries are similar to Python's builtin libraries as they provide a similar interface to match, filter, and glob the file system. But they also include diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/docs/src/markdown/.snippets/abbr.md new/wcmatch-11.0.1/docs/src/markdown/.snippets/abbr.md --- old/wcmatch-11.0/docs/src/markdown/.snippets/abbr.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/docs/src/markdown/.snippets/abbr.md 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1 @@ +*[ReDoS]: Regular Expression Denial of Service diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/docs/src/markdown/.snippets/links.md new/wcmatch-11.0.1/docs/src/markdown/.snippets/links.md --- old/wcmatch-11.0/docs/src/markdown/.snippets/links.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/docs/src/markdown/.snippets/links.md 2020-02-02 01:00:00.000000000 +0100 @@ -3,3 +3,4 @@ [glob]: https://docs.python.org/3/library/glob.html [fnmatch]: https://docs.python.org/3/library/fnmatch.html [unicode-properties]: https://facelessuser.github.io/backrefs/#special-syntax-exceptions +[regular-expression-redos]: https://www.regular-expressions.info/redos.html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/docs/src/markdown/about/changelog.md new/wcmatch-11.0.1/docs/src/markdown/about/changelog.md --- old/wcmatch-11.0/docs/src/markdown/about/changelog.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/docs/src/markdown/about/changelog.md 2020-02-02 01:00:00.000000000 +0100 @@ -1,5 +1,13 @@ # Changelog +## 11.0.1 + +- **DOCS**: Provide information in documentation that discloses information about what should or should not be + expected from Wildcard Match in regards to security, and provide general information to allow users to make good + decisions. +- **FIX**: Fix an issue where in some cases dot handling was not correct within an extended glob pattern when + `EXTGLOB`/`EXTMATCH` was enabled. + ## 11.0 - **NEW**: Reduce/combine nested `EXTGLOB`/`EXTMATCH` regular expression patterns when possible to reduce deeply diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/docs/src/markdown/about/release.md new/wcmatch-11.0.1/docs/src/markdown/about/release.md --- old/wcmatch-11.0/docs/src/markdown/about/release.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/docs/src/markdown/about/release.md 2020-02-02 01:00:00.000000000 +0100 @@ -196,11 +196,10 @@ escaping was disallowed, but now you can safely escape `{` and `}` to ensure optimal brace handling. While you can safely escape other meta characters in drives as well, it is never actually needed. -Additionally, [`glob.escape`](../glob.md#escape) and [`glob.raw_escape`](../glob.md#raw_escape) will automatically -escape `{`, `}` and `|` to avoid complications with [`BRACE`](../glob.md#brace) and [`SPLIT`](../glob.md#split). +Additionally, [`glob.escape`](../glob.md#escape) and `glob.raw_escape` will automatically escape `{`, `}` and `|` to +avoid complications with [`BRACE`](../glob.md#brace) and [`SPLIT`](../glob.md#split). -In general, a lot of corner cases with [`glob.escape`](../glob.md#escape) and [`glob.raw_escape`](../glob.md#raw_escape) -were cleaned up. +In general, a lot of corner cases with [`glob.escape`](../glob.md#escape) and `glob.raw_escape` were cleaned up. [`glob.escape`](../glob.md#escape) is meant to handle the escaping of normal paths so that they can be used in patterns. @@ -209,16 +208,15 @@ 'my\\\\file\\-\\[work\\].txt' ``` If you are accepting an input from a source that is giving you a representation of a Python string (where `\` is -represented by two `\`), then [`glob.raw_escape`](../glob.md#raw_escape) is what you want: +represented by two `\`), then `glob.raw_escape` is what you want: ```pycon >>> glob.raw_escape(r'my\\file-[work].txt', unix=False) 'my\\\\file\\-\\[work\\].txt' ``` -By default, [`glob.raw_escape`](../glob.md#raw_escape) always translates Python character back references into actual -characters, but if this is not needed, a new option called `raw_chars` (`True` by default) has been added to disable -this behavior: +By default, `glob.raw_escape` always translates Python character back references into actual characters, but if this is +not needed, a new option called `raw_chars` (`True` by default) has been added to disable this behavior: ```pycon >>> glob.raw_escape(r'my\\file-\x31.txt', unix=False) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/docs/src/markdown/fnmatch.md new/wcmatch-11.0.1/docs/src/markdown/fnmatch.md --- old/wcmatch-11.0/docs/src/markdown/fnmatch.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/docs/src/markdown/fnmatch.md 2020-02-02 01:00:00.000000000 +0100 @@ -351,7 +351,7 @@ If it is desired, you can force exclusion patterns, when no inclusion pattern is provided, to assume all files match unless the file matches the excluded pattern. This is done with the [`NEGATEALL`](#negateall) flag. -`NEGATE` enables [`DOTMATCH`](#dotglob) in all exclude patterns, this cannot be disabled. This will not affect the +`NEGATE` enables [`DOTMATCH`](#dotmatch) in all exclude patterns, this cannot be disabled. This will not affect the inclusion patterns. If `NEGATE` is set and exclusion patterns are passed via a matching function's `exclude` parameter, `NEGATE` will be @@ -404,6 +404,13 @@ > be treated as a [`NEGATE`](#negate) pattern (even if `!(` doesn't yield a > valid `EXTMATCH` pattern). To > negate a pattern that starts with a literal `(`, you must escape the > bracket: `!\(`. +> [!warning] +> When using extended glob patterns, groups are translated from glob groups to regular expression groups: `+(...)` -> +> `(...)+`, and so they are susceptible to the same kinds of performance based exploits that can occur in normal +> regular expression. Be thoughtful about the patterns you create with these groups, and if in important, time critical +> production systems, if the risk is not tolerable, do not enable. Read more about performance based issues in Regular +> Expressions [here][regular-expression-redos]. + #### `fnmatch.CAPTURE, glob.TC` {: #capture} > [!new] New 11.0 @@ -414,7 +421,7 @@ `+(a|b|c|)`, or `!(!(a|b))` -> `@(a|b)`. The [`translate()`](#translate) function will return the regular expression with capturing groups for each extended glob -group, when [`EXTMATCH`](#extglob) and `CAPTURE`. This has the side effect of disabling some regex optimizations related +group, when [`EXTMATCH`](#extmatch) and `CAPTURE`. This has the side effect of disabling some regex optimizations related to extended glob patterns, but this is to ensure that the input groups match the output groups. #### `fnmatch.BRACE, fnmatch.B` {: #brace} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/docs/src/markdown/glob.md new/wcmatch-11.0.1/docs/src/markdown/glob.md --- old/wcmatch-11.0/docs/src/markdown/glob.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/docs/src/markdown/glob.md 2020-02-02 01:00:00.000000000 +0100 @@ -876,7 +876,7 @@ the same and are provided as a convenience in case the user finds one more intuitive than the other since `DOTGLOB` is often the name used in Bash. -#### `glob.NODOTDIR, glob.Z` {: #globnodotdir} +#### `glob.NODOTDIR, glob.Z` {: #nodotdir} `NOTDOTDIR` fundamentally changes how glob patterns deal with `.` and `..`. This is great if you'd prefer a more Zsh feel when it comes to special directory matching. When `NODOTDIR` is enabled, "magic" patterns, such as `.*`, will not @@ -967,6 +967,13 @@ > be treated as a [`NEGATE`](#negate) pattern (even if `!(` doesn't yield a > valid `EXTGLOB` pattern). To negate > a pattern that starts with a literal `(`, you must escape the bracket: `!\(`. +> [!warning] +> When using extended glob patterns, groups are translated from glob groups to regular expression groups: `+(...)` -> +> `(...)+`, and so they are susceptible to the same kinds of performance based exploits that can occur in normal +> regular expression. Be thoughtful about the patterns you create with these groups, and if in important, time critical +> production systems, if the risk is not tolerable, do not enable. Read more about performance based issues in Regular +> Expressions [here][regular-expression-redos]. + #### `fnmatch.CAPTURE, glob.TC` {: #capture} > [!new] New 11.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/docs/src/markdown/index.md new/wcmatch-11.0.1/docs/src/markdown/index.md --- old/wcmatch-11.0/docs/src/markdown/index.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/docs/src/markdown/index.md 2020-02-02 01:00:00.000000000 +0100 @@ -1,7 +1,15 @@ # Wildcard Match + +> [!warning] Important Security Considerations! +> Learn more [here](#security-considerations), and be thoughtful about what you provide to this library in production +> systems. + ## Overview +Wildcard Match translates the more simple, path-centric syntax of glob patterns to regular expression for the purpose of +iterating and matching file systems + Wildcard Match provides an enhanced [`fnmatch`](./fnmatch.md), [`glob`](./glob.md), and [`pathlib`](./pathlib.md) library in order to provide file matching and globbing that more closely follows the features found in Bash. In some ways these libraries are similar to Python's builtin libraries as they provide a similar interface to match, filter, and @@ -53,3 +61,73 @@ - [`glob`](./glob.md): A file system searching and file path matching library. - [`pathlib`](./pathlib.md): A implementation of Python's `pathlib` that uses our own `glob` implementation. - [`wcmatch`](./wcmatch.md): An alternative file search library built on `fnmatch` and `globmatch`. + +## Security Considerations + +Wildcard Match makes globing with regular expressions easier and allows translation of the more simple, path-centric +syntax of glob patterns to regular expression for the purpose of iterating and matching file systems. + +Regular expression engines like those in JavaScript, Python, Java, etc. choose compatibility and expressiveness over +guaranteed performance, accepting the risk of catastrophic backtracking when patterns contain nested quantifiers or +overlapping alternations. + +ReDoS (Regular Expression Denial of Service) cases are those that specifically target the areas where a regular +expression engine does not guarantee optimal performance. + +Because Wildcard Match builds its matching upon the Python regular expression engine, it can take advantage of the +engine's power, but is also susceptible to the engine's weaknesses. + +We take security seriously, and have taken many measures to reduce cases with less efficient patterns and logic, but it +is important to note that it will always be susceptible to some ReDoS cases because it is built on an engine that is +susceptible to ReDoS cases. + +In general, we try to be transparent about features that we know, or later discover to be, susceptible to performance +based issues. Often, the more powerful and expressive the feature, the more susceptible it may be to such cases. + +- `EXTGLOB`/`EXTMATCH` flags allow for powerful groups of patterns that align with regular expression groups (e.g. + `(...)+`, `(...)*`, `(...)?`, etc.). Extended glob patterns allow for more complex combinations without expanding a + pattern into multiple patterns, but with this expressiveness comes the increased possibility of creating patterns + that could cause overlapping alternations and/or catastrophic backtracking. The same rules for crafting good regular + expression groups should be applied to extend glob patterns in the form: `@(...)`, `+(...)`, `*(...)`, `?(...)`, and + `!(...)`. + + Scanning for potential pattern overlaps within extended glob patterns would be very expensive and error prone to + perform on our end. If running in an environment where the risk of sub-optimal performance is not tolerable, this + behavior is optional and does not need to be enabled. + +Not all potential performance issues are specifically related to ReDoS. + +- The `BRACES` flag is very powerful and functionally different than extended glob patterns. Instead of using regular + expression branching logic via groups,`BRACES` allows a user to quickly transform a single pattern into multiple, + separate pattern combinations. With this power, a single pattern may expand into 10, 100, or even 10000 patterns. + Each pattern must be iterated separately. This explosion in patterns is extremely useful if used thoughtfully, but + can also impact performance at undesirable times if used carelessly. + + By default, we provide limits to pattern expansions, but users are responsible for setting limits that they find + appropriate. If the risk of pattern expansions outweighs the usefulness for the given user, the feature is optional + and does not need to be enabled. + +Below is our general guide for using Wildcard Match safely: + +- Wildcard Match usage should be treated similar to regular expression usage as input patterns into Wildcard Match + become regular expression patterns. +- The user should make themselves aware of the types of bad patterns that should be avoided when using regular + expression groups and apply them to extended glob groups. +- If this tool is being deployed in an environment where the risks of using a specific optional feature cannot be + tolerated, it should not be enabled. +- The user should be thoughtful about where Wildcard Match is deployed. +- Limiting the size of user input is always a good practice if the intent is to allow processing untrusted user input. + +Wildcard Match does not limit input string sizes ourselves and place that responsibility on the user. We do not restrict +which features a user can use, but try to be clear about the pros and cons of the feature and allow the user to +enable/disable them using their own judgement. + +We will do our best to fix or reduce any issues brought to our attention, performance or otherwise, especially if the +cost is reasonable to address on our side, but we do not guarantee performance in all cases. For any issues that are not +practical to fix on our side, and are explicitly caused by the regular expression engine, we will redirect reports to +this section within our documentation as our official answer. + +Lastly, and to make things abundantly clear, if you create a performance critical system where you take user input and +use that input as the source of regular expression patterns, **you will be subject to performance based +vulnerabilities**. Please use this tool in appropriate environments and thoughtfully consider which features to use in +order to reduce the risk of exposure. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/docs/src/markdown/pathlib.md new/wcmatch-11.0.1/docs/src/markdown/pathlib.md --- old/wcmatch-11.0/docs/src/markdown/pathlib.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/docs/src/markdown/pathlib.md 2020-02-02 01:00:00.000000000 +0100 @@ -600,6 +600,13 @@ > be treated as a [`NEGATE`](#negate) pattern (even if `!(` doesn't yield a > valid `EXTGLOB` pattern). To negate > a pattern that starts with a literal `(`, you must escape the bracket: `!\(`. +> [!warning] +> When using extended glob patterns, groups are translated from glob groups to regular expression groups: `+(...)` -> +> `(...)+`, and so they are susceptible to the same kinds of performance based exploits that can occur in normal +> regular expression. Be thoughtful about the patterns you create with these groups, and if in important, time critical +> production systems, if the risk is not tolerable, do not enable. Read more about performance based issues in Regular +> Expressions [here][regular-expression-redos]. + #### `pathlib.BRACE, pathlib.B` {: #brace} `BRACE` enables Bash style brace expansion: `a{b,{c,d}}` --> `ab ac ad`. Brace expansion is applied before anything diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/docs/src/markdown/wcmatch.md new/wcmatch-11.0.1/docs/src/markdown/wcmatch.md --- old/wcmatch-11.0/docs/src/markdown/wcmatch.md 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/docs/src/markdown/wcmatch.md 2020-02-02 01:00:00.000000000 +0100 @@ -348,9 +348,16 @@ etc. > [!tip] EXTMATCH and NEGATE -> When using `EXTMATCH` and [`NEGATE`](#negate) together, if a pattern starts with `!(`, the pattern will not -> be treated as a [`NEGATE`](#negate) pattern (even if `!(` doesn't yield a valid `EXTMATCH` pattern). To -> negate a pattern that starts with a literal `(`, you must escape the bracket: `!\(`. +> When using `EXTMATCH` and `NEGATE` (the default) together, if a pattern starts with `!(`, the pattern will not be +> treated as a `NEGATE` pattern (even if `!(` doesn't yield a valid `EXTMATCH` pattern). To negate a pattern that starts +> with a literal `(`, you must escape the bracket: `!\(`. + +> [!warning] +> When using extended glob patterns, groups are translated from glob groups to regular expression groups: `+(...)` -> +> `(...)+`, and so they are susceptible to the same kinds of performance based exploits that can occur in normal +> regular expression. Be thoughtful about the patterns you create with these groups, and if in important, time critical +> production systems, if the risk is not tolerable, do not enable. Read more about performance based issues in Regular +> Expressions [here][regular-expression-redos]. #### `wcmatch.BRACE, wcmatch.B` {: #brace} @@ -370,12 +377,12 @@ > [!warning] Massive Expansion Risk > 1. It is important to note that each pattern is matched separately, so > patterns such as `{1..100}` would generate -> **one hundred** patterns. Since [`WcMatch`](#wcmatch_1) class is able to crawl the file system one pass +> **one hundred** patterns. Since [`WcMatch`](#methods) class is able to crawl the file system one pass > accounting for all the patterns, the performance isn't as bad as it may > be with [`glob`](./glob.md), but it can > still impact performance as each file must get compared against many > patterns until one is matched. Sometimes > patterns like this are needed, so construct patterns thoughtfully and > carefully. > -> 2. Splitting patterns with `|` is built into [`WcMatch`](#wcmatch_1). `BRACE` and splitting with `|` both expand +> 2. Splitting patterns with `|` is built into [`WcMatch`](#methods). `BRACE` and splitting with `|` both expand > patterns into multiple patterns. Using these two syntaxes simultaneously > can exponential increase in duplicate > patterns: > @@ -423,7 +430,7 @@ #### `wcmatch.PATHNAME, wcmatch.P` {: #pathname} -`PATHNAME` enables both [`DIRPATHNAME`](#dirpathname) and [`FILEPATHNAME`](#wcmathfilepathname). It is provided +`PATHNAME` enables both [`DIRPATHNAME`](#dirpathname) and [`FILEPATHNAME`](#filepathname). It is provided for convenience. #### `wcmatch.MATCHBASE, wcmatch.X` {: #matchbase} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/tests/test_fnmatch.py new/wcmatch-11.0.1/tests/test_fnmatch.py --- old/wcmatch-11.0/tests/test_fnmatch.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/tests/test_fnmatch.py 2020-02-02 01:00:00.000000000 +0100 @@ -124,6 +124,9 @@ ['*(?|*)abc', '.abc', True, fnmatch.E], ['!(test)', '.abc', True, fnmatch.E], ['!(test)', '..', True, fnmatch.E], + ['+([a.])', '.a', True, fnmatch.E], + ['+([a.])', 'a.', True, fnmatch.E], + ['+([a.])', 'a..', True, fnmatch.E], # Turn off `dotmatch` cases ['.abc', '.abc', True, fnmatch.D], @@ -148,6 +151,9 @@ ['!(test)', '.abc', False, fnmatch.D | fnmatch.E], ['!(test)', 'abc', True, fnmatch.D | fnmatch.E], ['!(test)', '..', False, fnmatch.D | fnmatch.E], + ['+([a.])', '.a', False, fnmatch.E | fnmatch.D], + ['+([a.])', 'a.', True, fnmatch.E | fnmatch.D], + ['+([a.])', 'a..', True, fnmatch.E | fnmatch.D], # Negation list followed by extended list ['!(2)_@(foo|bar)', '1_foo', True, fnmatch.E], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/tests/test_globmatch.py new/wcmatch-11.0.1/tests/test_globmatch.py --- old/wcmatch-11.0/tests/test_globmatch.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/tests/test_globmatch.py 2020-02-02 01:00:00.000000000 +0100 @@ -949,6 +949,20 @@ ['!(not)!( this)@( okay)', 'but this okay', True, glob.N], ['@(but!( that))@( okay)', "but this okay", True, glob.N], ['!(@(but!( that))@( okay))', "but this okay", False, glob.N], + + # Dot logic + ['+([a.])', '.a', False], + ['+([a.])', 'a.', True], + ['+([a.])', 'a..', True], + ['/+([a.])', '/.a', False], + ['/+([a.])', '/a.', True], + ['/+([a.])', '/a..', True], + ['+([a.])', '.a', True, glob.D], + ['+([a.])', 'a.', True, glob.D], + ['+([a.])', 'a..', True, glob.D], + ['/+([a.])', '/.a', True, glob.D], + ['/+([a.])', '/a.', True, glob.D], + ['/+([a.])', '/a..', True, glob.D] ] @classmethod @@ -1153,8 +1167,8 @@ value = ( [ '^(?s:(?:(?!(?:[/]|^)\\.).)*?(?:^|$|[/])+' + - ('(?!(?:\\.{1,2})(?:$|[/]))(?![/.])[\x00-\x7f][/]+stuff[/]+(?=[^/])') + - '(?!(?:\\.{1,2})(?:$|[/]))(?:(?!\\.)[^/]*?)?[/]*?)$' + ('(?!(?:(?<=[/])|(?<=^))(?:\\.{1,2})(?:$|[/]))(?![/.])[\x00-\x7f][/]+stuff[/]+(?=[^/])') + + '(?!(?:(?<=[/])|(?<=^))(?:\\.{1,2})(?:$|[/]))(?:(?!\\.)[^/]*?)?[/]*?)$' ], [] ) @@ -1170,7 +1184,7 @@ flags = self.flags flags |= glob.FORCEUNIX - value = (['^(?s:(?=[^/])(?!(?:\\.{1,2})(?:$|[/]))(?:(?!\\.)[^/]*?)?test[^/]*?[/]*?)$'], []) + value = (['^(?s:(?=[^/])(?!(?:(?<=[/])|(?<=^))(?:\\.{1,2})(?:$|[/]))(?:(?!\\.)[^/]*?)?test[^/]*?[/]*?)$'], []) self.assertEqual( glob.translate('****test****', flags=flags), value diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/wcmatch/__meta__.py new/wcmatch-11.0.1/wcmatch/__meta__.py --- old/wcmatch-11.0/wcmatch/__meta__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/wcmatch/__meta__.py 2020-02-02 01:00:00.000000000 +0100 @@ -193,5 +193,5 @@ return Version(major, minor, micro, release, pre, post, dev) -__version_info__ = Version(11, 0, 0, "final") +__version_info__ = Version(11, 0, 1, "final") __version__ = __version_info__._get_canonical() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/wcmatch-11.0/wcmatch/_wcparse.py new/wcmatch-11.0.1/wcmatch/_wcparse.py --- old/wcmatch-11.0/wcmatch/_wcparse.py 2020-02-02 01:00:00.000000000 +0100 +++ new/wcmatch-11.0.1/wcmatch/_wcparse.py 2020-02-02 01:00:00.000000000 +0100 @@ -213,7 +213,7 @@ # For paths, allow trailing / _PATH_TRAIL = r'{}*?' # Disallow . and .. (usually applied right after path separator when needed) -_NO_DIR = r'(?!(?:\.{{1,2}})(?:$|[{sep}]))' +_NO_DIR = r'(?!(?:(?<=[{sep}])|(?<=^))(?:\.{{1,2}})(?:$|[{sep}]))' # Star for `PATHNAME` _PATH_STAR = r'[^{sep}]*?' # Star when at start of filename during `DOTMATCH` @@ -228,6 +228,10 @@ _PATH_GSTAR_NO_DOTMATCH = r'(?:(?!(?:[{sep}]|^)\.).)*?' # Next char cannot be a dot _NO_DOT = r'(?![.])' +# Restrict dot in an extended group +_GROUP_NO_DOT = r'(?!(?<=^)\.)' +# Restrict dot in an extended path group +_PATH_GROUP_NO_DOT = r'(?!(?:(?<=[{sep}])|(?<=^))\.)' # Following char from sequence cannot be a separator or a dot _PATH_NO_SLASH_DOT = r'(?![{sep}.])' # Following char from sequence cannot be a separator @@ -959,6 +963,7 @@ self.no_dir = _NO_DIR.format(**sep) self.seq_path = _PATH_NO_SLASH.format(**sep) self.seq_path_dot = _PATH_NO_SLASH_DOT.format(**sep) + self.seq_path_group_dot = _PATH_GROUP_NO_DOT.format(**sep) self.path_star = _PATH_STAR.format(**sep) self.path_star_dot1 = _PATH_STAR_DOTMATCH.format(**sep) self.path_star_dot2 = _PATH_STAR_NO_DOTMATCH.format(**sep) @@ -1010,11 +1015,15 @@ """Restrict sequence.""" if self.pathname: - value = self.seq_path_dot if self.after_start and not self.dot else self.seq_path + if self.after_start and not self.dot: + value = self.seq_path_dot if not self.in_list else self.seq_path_group_dot + else: + value = self.seq_path if self.after_start: value = self.no_dir + value else: - value = _NO_DOT if self.after_start and not self.dot else "" + value = (_NO_DOT if not self.in_list else _GROUP_NO_DOT) if self.after_start and not self.dot else "" + self.reset_dir_track() return value
