diff options
| author | shadchin <[email protected]> | 2026-06-24 07:09:14 +0300 |
|---|---|---|
| committer | shadchin <[email protected]> | 2026-06-24 07:31:09 +0300 |
| commit | 280914cd46f4411a2e01150bf9d9c53dff19fa66 (patch) | |
| tree | 841d7b8330cb51e86f2ea6e915e4904563321aca /contrib/tools/python3/Lib/configparser.py | |
| parent | 1100ced6faf1d14f48cb041f885882d3b37491a2 (diff) | |
Update Python 3 to 3.13.14
commit_hash:9913a0288f56b5ddd0f99e5b2ff1569d491cbe5d
Diffstat (limited to 'contrib/tools/python3/Lib/configparser.py')
| -rw-r--r-- | contrib/tools/python3/Lib/configparser.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/contrib/tools/python3/Lib/configparser.py b/contrib/tools/python3/Lib/configparser.py index 05b86acb919..3968ac45eed 100644 --- a/contrib/tools/python3/Lib/configparser.py +++ b/contrib/tools/python3/Lib/configparser.py @@ -316,12 +316,15 @@ class ParsingError(Error): def append(self, lineno, line): self.errors.append((lineno, line)) - self.message += '\n\t[line %2d]: %s' % (lineno, repr(line)) + self.message += f'\n\t[line {lineno:2d}]: {line!r}' def combine(self, others): + messages = [self.message] for other in others: - for error in other.errors: - self.append(*error) + for lineno, line in other.errors: + self.errors.append((lineno, line)) + messages.append(f'\n\t[line {lineno:2d}]: {line!r}') + self.message = "".join(messages) return self @staticmethod @@ -597,7 +600,9 @@ class RawConfigParser(MutableMapping): \] # ] """ _OPT_TMPL = r""" - (?P<option>.*?) # very permissive! + (?P<option> # very permissive! + (?:(?!{delim})\S)* # non-delimiter non-whitespace + (?:\s+(?:(?!{delim})\S)+)*) # optionally more words \s*(?P<vi>{delim})\s* # any number of space/tab, # followed by any of the # allowed delimiters, @@ -605,7 +610,9 @@ class RawConfigParser(MutableMapping): (?P<value>.*)$ # everything up to eol """ _OPT_NV_TMPL = r""" - (?P<option>.*?) # very permissive! + (?P<option> # very permissive! + (?:(?!{delim})\S)* # non-delimiter non-whitespace + (?:\s+(?:(?!{delim})\S)+)*) # optionally more words \s*(?: # any number of space/tab, (?P<vi>{delim})\s* # optionally followed by # any of the allowed |
