On Mon, May 29, 2023 at 10:47 PM Jun Omae <jun6...@gmail.com> wrote: > > On 2023/05/29 20:09, Daniel Sahlberg wrote: > > > For test 17: > > > [[[ > > > File "C:\usr\apps\python312\Lib\re\_parser.py", line 383, in _escape > > > raise source.error("incomplete escape %s" % escape, len(escape)) > > > re.error: incomplete escape \u at position 34 > > > ]]] > > > > > > I suppose this is because the expected_error is constructed like this: > > > [[[ > > > expected_error = "svn: E200007: Cannot move path '%s' into its own > > " \ > > > "child '%s'" % (from_path, to_path) > > > ]]] > > > > > > With a from_path C:\usr\subversion\[...], I suppose Python interpret > > \ as an escape character. I'm not proficient enough in Python to have an > > idea of how to escape from_path and to_path in an appropriate way. @Jun, do > > you have a suggestion? > > > > The following patch could fix it and verified (applying `re.escape` to > > the paths). > > > > [[[ > > Index: subversion/tests/cmdline/copy_tests.py > > =================================================================== > > --- subversion/tests/cmdline/copy_tests.py (revision 1910112) > > +++ subversion/tests/cmdline/copy_tests.py (working copy) > > @@ -1295,7 +1295,7 @@ def wc_move_parent_into_child(sbox): > > os.chdir(wc_dir) > > > > expected_error = "svn: E200007: Cannot move path '%s' into its own " > > \ > > - "child '%s'" % (from_path, to_path) > > + "child '%s'" % (re.escape(from_path), > > re.escape(to_path)) > > svntest.actions.run_and_verify_svn(None, expected_error, > > 'mv', > > '.', 'F/B') > > ]]] > > > > > > Sounds good, thanks for your suggestion. Would you like to commit? > > I just pushed the changes in r1910129.
I'm running into a strange failure with the above test (copy_tests.py 17: move WC WC/subdir). The paths we construct for expected_error are not matching the actual error in my system. I tried various things but nothing seems to help. Looking around the testsuite, I tried changing '%s' to '.*%s'; also I tried removing os.path.abspath when constructing from_path and to_path; I made various other attempts, all aimed at minimally matching the known portion of the path while ignoring the extra stuff. Unfortunately I was not successful. This is on trunk, as of r1912743 (the latest right now), Linux Debian, Python 3.7.5, building SVN with --enable-maintainer-mode (this might account for some extra text in the actual error message?). All other tests are passing for me, for all [local|svn|serf] x [fsfs]. Fail log: [[[ W: Unexpected output W: EXPECTED STDERR (regexp, match_all=False): W: | svn: E200007: Cannot move path '/home/nathan/ramdrive/svndev/svn\-trunk/subversion/tests/cmdline/svn\-test\-work/working_copies/copy_tests\-17' into its own child '/home/nathan/ramdrive/svndev/svn\-trunk/subversion/tests/cmdline/svn\-test\-work/working_copies/copy_tests\-17/F/B' W: ACTUAL STDERR: W: | subversion/svn/move-cmd.c:102, W: | subversion/svn/util.c:557, W: | subversion/libsvn_client/copy.c:3495, W: | subversion/libsvn_client/copy.c:3093: (apr_err=SVN_ERR_UNSUPPORTED_FEATURE) W: | svn: E200007: Cannot move path '/home/nathan/ramdrive/svndev/ramdisk/svn-trunk/working_copies/copy_tests-17' into its own child '/home/nathan/ramdrive/svndev/ramdisk/svn-trunk/working_copies/copy_tests-17/F/B' W: CWD: /home/nathan/ramdrive/svndev/ramdisk/svn-trunk/working_copies/copy_tests-17 W: EXCEPTION: SVNUnmatchedError Traceback (most recent call last): File "/home/nathan/ramdrive/svndev/svn-trunk/subversion/tests/cmdline/svntest/main.py", line 1996, in run rc = self.pred.run(sandbox) File "/home/nathan/ramdrive/svndev/svn-trunk/subversion/tests/cmdline/svntest/testcase.py", line 178, in run result = self.func(sandbox) File "/home/nathan/ramdrive/svndev/svn-trunk/subversion/tests/cmdline/copy_tests.py", line 1299, in wc_move_parent_into_child '.', 'F/B') File "/home/nathan/ramdrive/svndev/svn-trunk/subversion/tests/cmdline/svntest/actions.py", line 340, in run_and_verify_svn expected_exit, *varargs) File "/home/nathan/ramdrive/svndev/svn-trunk/subversion/tests/cmdline/svntest/actions.py", line 380, in run_and_verify_svn2 expected_stdout, expected_stderr) File "/home/nathan/ramdrive/svndev/svn-trunk/subversion/tests/cmdline/svntest/verify.py", line 532, in verify_outputs compare_and_display_lines(message, label, expected, actual, raisable) File "/home/nathan/ramdrive/svndev/svn-trunk/subversion/tests/cmdline/svntest/verify.py", line 505, in compare_and_display_lines raise raisable svntest.main.SVNUnmatchedError FAIL: copy_tests.py 17: move WC WC/subdir ]]] Any ideas? Cheers, Nathan