Den tis 30 maj 2023 kl 04:46 skrev Jun Omae <jun6...@gmail.com>:

> I just pushed the changes in r1910129.
>

Excellent, thanks!


> >     > (Sidenote: There is an error message in the test log about line
> 1424. This was added way back in r846892 and has essentially been unchanged
> ever since. I believe this is unrelated and I will send this in a separate
> thread when I've had some more time to look at it).
> >
> >     The `SyntaxWarning` from line 1424 is displayed since Python 3.12,
> even without -Wdefault option.
> >
> >     $ python3.12 -c '"\$"'
> >     <string>:1: SyntaxWarning: invalid escape sequence '\$'
> >     $ python3.11 -c '"\$"'   # no warnings
> >     $ python3.11 -Wdefault -c '"\$"'
> >     <string>:1: DeprecationWarning: invalid escape sequence '\$'
> >
> >     See also:
> https://docs.python.org/3.12/whatsnew/3.12.html?highlight=backslash-character#other-language-changes
> <
> https://docs.python.org/3.12/whatsnew/3.12.html?highlight=backslash-character#other-language-changes
> >
> >
> >
> > If I understand this correctly, the string should be declared as raw
> instead of binary:
> > [[[
> > Index: subversion/tests/cmdline/copy_tests.py
> > ===================================================================
> > --- subversion/tests/cmdline/copy_tests.py      (revision 1910111)
> > +++ subversion/tests/cmdline/copy_tests.py      (working copy)
> > @@ -1421,7 +1421,7 @@
> >    if re.match(b'[^\\r]\\n', raw_contents):
> >      raise svntest.Failure
> >
> > -  if not re.match(b'.*\$LastChangedRevision:\s*\d+\s*\$',
> line_contents[3]):
> > +  if not re.match(r'.*\$LastChangedRevision:\s*\d+\s*\$',
> line_contents[3]):
> >      raise svntest.Failure
> >
> >  #-------------------------------------------------------------
> > ]]]
> >
> > Maybe the previous re.match (first context line in the diff) should be
> changed as well?
>
> The literal for the regular expression should be a bytes instance because
> line_contents[3] is a bytes instance.
> If Python is 3.3 or later, we could use a raw bytes literal.
>
> [[[
> -  if not re.match(b'.*\$LastChangedRevision:\s*\d+\s*\$',
> line_contents[3]):
> +  if not re.match(rb'.*\$LastChangedRevision:\s*\d+\s*\$',
> line_contents[3]):
> ]]]
>
> However, in attached patch, correct the escape sequences because "make
> check" requires at least Python 3.0.
>
> [[[
> -  if not re.match(b'.*\$LastChangedRevision:\s*\d+\s*\$',
> line_contents[3]):
> +  if not re.match(b'.*\\$LastChangedRevision:\\s*\\d+\\s*\\$',
> line_contents[3]):
> ]]]
>
> The patch fixes many "invalid escape sequences" which exist in also other
> Python scripts (verified unit tests with Python 3.5 and 3.12 on Ubuntu, and
> Python 3.12 on Windows).
>

I checked the changes and it looks good as far as I understand. I've also
run the testsuite (make check, make davautocheck, make svnserveautocheck)
with Python 3.11.2 on Ubuntu (WSL), all seems fine.

Kind regards,
Daniel Sahlberg

Reply via email to