Wcmatch

Latest version: v10.0

Safety actively analyzes 682361 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 8

6.1

- **NEW**: `EXTMATCH`/`EXTGLOB` can now be used with `NEGATE` without needing `MINUSNEGATE`. If a pattern starts with `!(`, and `NEGATE` and `EXTMATCH`/`EXTGLOB` are both enabled, the pattern will not be treated as a `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: `!\(`.
- **FIX**: Support Python 3.9.
- **FIX**: Adjust pattern limit logic of `glob` to be consistent with other functions.

6.0.3

- **FIX**: Fix issue where when `FOLLOW` and `GLOBSTAR` were used, a pattern like `**/*` would not properly match a directory which was a symlink. While Bash does not return a symlinked folder with `**`, `*` (and other patterns), should properly find the symlinked directory.
- **FIX**: `pathlib` clearly states that the `match` method, if the pattern is relative, matches from the right. Wildcard Match used the same implementation that `rglob` used, which prepends `**/` to a relative pattern. This is essentially like `MATCHBASE`, but allows for multiple directory levels. This means that dot files (and special folders such as `.` and `..`) on the left side could prevent the path from matching depending on flags that were set. `match` will now be evaluated in such a way as to give the same right to left matching feel that Python's `pathlib` uses.

6.0.2

- **FIX**: Fix logic related to dot files and `GLOBSTAR`. Recursive directory search should return all dot files, which should then be filtered by the patterns. They should not be excluded before being filtered by the pattern.

6.0.1

- **FIX**: If we only have one pattern (exclusion patterns not included) we can disable unique path filtering on returns as you cannot have a duplicate path with only one inclusion pattern.

6.0.0

- **NEW**: Tilde user expansion support via the new `GLOBTILDE` flag.
- **NEW**: `glob` by default now returns only unique results, regardless of whether multiple patterns that match the
same file were provided, or even when `BRACE` or `SPLIT` expansion produces new patterns that match the same file.
- **NEW**: A new flag called `NOUNIQUE` has been added that makes `glob` act like Bash, which will return the same file multiple times if multiple patterns match it, whether provided directly or due to the result of `BRACE` or `SPLIT` expansion.
- **NEW**: Limit number of patterns that can be processed (expanded and otherwise) to 1000. Allow user to change this value via an optional `limit` parameter in related API functions.
- **FIX**: Matching functions that receive multiple patterns, or that receive a single pattern that expands to multiple, will filter out duplicate patterns in order avoid redundant matching. While the `WcMatch` class crawls the file system, it utilizes the aforementioned matching functions in it's operation, and indirectly takes advantage of this. `glob` (and related functions: `rglob`, `iglob`, etc.) will also filter redundant patterns except when `NOUNIQUE` is enabled, this is so they can better act like Bash when `NOUNIQUE` is enabled.
- **FIX**: `BRACE` is now processed before `SPLIT` in order to fix a number of edge cases.
- **FIX**: `RAWCHARS` was inconsistently applied at different times depending on what was calling it. It is now applied first followed by `BRACE`, `SPLIT`, and finally `GLOBTILDE`.

5.1.0

- **NEW**: Add new parameter to `glob` related functions (except in `pathlib`) called `root_dir` that allows a user to specify a different working directory with either a string or path-like object. Path-like inputs are only supported on Python 3.6+.
- **NEW**: Support path-like objects for `globmatch` and `globfilter` path inputs. Path-like inputs are only supported on Python 3.6+.
- **FIX**: Filter functions should not alter the slashes of files it filters. Filtered strings and paths should be returned unaltered.

Page 4 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.