-
Notifications
You must be signed in to change notification settings - Fork 83
Open
Description
Recently noticed that all CI runs using Python 3.14 are failing with AssertionError: assert '(?s:foo[^/]*)\\z' == '(?s:foo[^/]*)\\Z'.
This includes the jobs test (3.14, ubuntu-latest) and collateral (diffcov).
Complete error:
_________________________ TestFileList.test_glob_to_re _________________________
self = <distutils.tests.test_filelist.TestFileList object at 0x7f78b4447390>
def test_glob_to_re(self):
sep = os.sep
if os.sep == '\\':
sep = re.escape(os.sep)
for glob, regex in (
# simple cases
('foo*', r'(?s:foo[^%(sep)s]*)\Z'),
('foo?', r'(?s:foo[^%(sep)s])\Z'),
('foo??', r'(?s:foo[^%(sep)s][^%(sep)s])\Z'),
# special cases
(r'foo\\*', r'(?s:foo\\\\[^%(sep)s]*)\Z'),
(r'foo\\\*', r'(?s:foo\\\\\\[^%(sep)s]*)\Z'),
('foo????', r'(?s:foo[^%(sep)s][^%(sep)s][^%(sep)s][^%(sep)s])\Z'),
(r'foo\\??', r'(?s:foo\\\\[^%(sep)s][^%(sep)s])\Z'),
):
regex = regex % {'sep': sep}
> assert glob_to_re(glob) == regex
E AssertionError: assert '(?s:foo[^/]*)\\z' == '(?s:foo[^/]*)\\Z'
E
E - (?s:foo[^/]*)\Z
E ? ^
E + (?s:foo[^/]*)\z
E ? ^
distutils/tests/test_filelist.py:64: AssertionErrorLooks like https://docs.python.org/3/library/fnmatch.html#fnmatch.translate changed in an undocumented way in 3.14:
> uvx --python=3.13 python -c "import fnmatch; print(fnmatch.translate('foo*'))"
(?s:foo.*)\Z
> uvx --python=3.14 python -c "import fnmatch; print(fnmatch.translate('foo*'))"
(?s:foo.*)\z
Metadata
Metadata
Assignees
Labels
No labels