[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: One more issue in tests on Windows with Python 3

From: Johan Corveleyn <jcorvel_at_gmail.com>
Date: Mon, 25 May 2020 22:23:34 +0200

On Thu, May 14, 2020 at 3:55 AM Yasuhito FUTATSUKI <futatuki_at_poem.co.jp> wrote:
>
> On 2020/05/13 9:57, Daniel Shahaf wrote:
> > Yasuhito FUTATSUKI wrote on Wed, 13 May 2020 07:11 +0900:
> >> On 2020/05/10 1:24, Daniel Shahaf wrote:
> >>> Yasuhito FUTATSUKI wrote on Fri, 08 May 2020 20:55 +0900:
> >>>> On 2020/05/08 2:46, Daniel Shahaf wrote:
> >>>>> Yasuhito FUTATSUKI wrote on Thu, 07 May 2020 20:46 +0900:
> >>>>>> I think it is need to escape characters in char *value when we print
> >>>> ^some (not all)
> >>>>>> them as Python's str value. The patch below may work for this purpose,
> >>>>>> but I want someone to write more nice code :)
> >>>>>
> >>>>> How about simply adding the human-readable value in a comment? —
> >>>>
> >>>> It's very nice. One of the reason I don't like my code is just
> >>>> readability of the value of "value".
> >>>
> >>> Sure, in general it's nice for protocols and serialization formats to
> >>> be texty, in order for them to be human-readable and -writable. On
> >>> this instance, however, generating Python string literals that are both
> >>> correct and human-readable seems to me like it'd be an effort spent for
> >>> little gain. (I think there's a good chance that no one will _ever_
> >>> run entries-dump by hand again once it properly supports Python 3.)
> >>>
> >>> One easy way to make the output nicer is to name the lambda function.
> >>
> >> Yes, it's also one of the reasons that it uses lambda function.
> >> I use it only to reduce the occurence of 'value' in
> >>
> >> e.name = value if isinstance(value, str) else value.decode()
> >>
> >> without using temporary named object, in the first patch.
> >>
> >> Then I updated the patch. Not to use lambda function, I added
> >> a method to set str attribute from bytes object to "Entry" class,
> >> and move its definition to the output of entries-dump to show
> >> what it does.
> >
> > Thanks. Feel free to commit whichever variant you prefer. They're all
> > functionally identical to one another, so whoever writes the code gets
> > to choose.
> >
> > Review:
>
> Thank you for the review. I've commited in 1877712, and I'm waiting
> for the results of buildbots.

Hmm, I still get this test failure, with trunk_at_today, when running
update_tests.py with ra_serf, with Python 3.8.2 on Windows.

[[[
C:\research\svn\dev\trunk>python win-tests.py -c --log-level=DEBUG -p
--httpd-dir=C:\Apache2.4.43 --httpd-port=1234 --httpd-no-log -t update
...
FAIL: update_tests.py 76: test filename with backslashes inside
]]]

dav-fails.log contains:

[[[
I: CMD: entries-dump.exe --tree-dump
svn-test-work\working_copies\update_tests-76
W: CWD: R:\test_release-p--httpd-dirC__Apache2.4.43--httpd-port1234--httpd-no-log-tupdate\subversion\tests\cmdline
Traceback (most recent call last):
  File "C:\research\svn\dev\trunk\subversion\tests\cmdline\svntest\main.py",
line 1927, in run
    rc = self.pred.run(sandbox)
  File "C:\research\svn\dev\trunk\subversion\tests\cmdline\svntest\testcase.py",
line 258, in run
    return self._delegate.run(sandbox)
  File "C:\research\svn\dev\trunk\subversion\tests\cmdline\svntest\testcase.py",
line 178, in run
    result = self.func(sandbox)
  File "C:\research\svn\dev\trunk\subversion\tests\cmdline\update_tests.py",
line 6382, in windows_update_backslash
    svntest.actions.run_and_verify_status(wc_dir, expected_status)
  File "C:\research\svn\dev\trunk\subversion\tests\cmdline\svntest\actions.py",
line 1605, in run_and_verify_status
    actual_entries = wc.State.from_entries(wc_dir_name)
  File "C:\research\svn\dev\trunk\subversion\tests\cmdline\svntest\wc.py",
line 744, in from_entries
    dump_data = svntest.main.run_entriesdump_tree(base)
  File "C:\research\svn\dev\trunk\subversion\tests\cmdline\svntest\main.py",
line 929, in run_entriesdump_tree
    exec(''.join(filter_dbg(stdout_lines)))
  File "<string>", line 280
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes
in position 10-11: truncated \uXXXX escape
FAIL: update_tests.py 76: test filename with backslashes inside
]]]

See entire dav-fails.log in attachment.

Any ideas? Is there something wrong with the fix of r1877712? Or is
there some other code path that runs into the same issue that wasn't
addressed by r1877712?

-- 
Johan

Received on 2020-05-25 22:23:52 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.