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

Re: svn commit: r1743556 - /subversion/trunk/build/run_tests.py

From: Stefan Fuhrmann <stefanfuhrmann_at_alice-dsl.de>
Date: Fri, 13 May 2016 19:42:48 +0200

On 13.05.2016 02:54, Branko Čibej wrote:
> On 13.05.2016 00:00, Evgeny Kotkov wrote:
>> Stefan Fuhrmann <stefan2_at_apache.org> writes:
>>
>>> TestHarness._run_test): The log is binary data, so write byte strings
>>> to it.
>> [...]
>>
>>> if self.opts.list_tests:
>>> - log.write('LISTING: %s\n' % progbase)
>>> + log.write(('LISTING: %s\n' % progbase).encode())
>>> else:
>>> - log.write('START: %s\n' % progbase)
>>> + log.write(('START: %s\n' % progbase).encode())
>> Hm, do these log.write() calls always expect bytes? I see that `log'
>> can be set to two different values, as per run_tests.py:880:
>>
>> if self.log:
>> log = self.log
>> else:
>> log = sys.stdout # with --log-to-stdout
>>
>> And sys.stdout.write() works with strings, so this probably won't work
>> if tests are run with the --log-to-stdout option.
> I was thinking about that, yes. Instead of opening log files with
> open(), then encoding everything written to them ... I believe it would
> be better to open the files with codecs.open(). This should work for
> expected results and such, too, I think, and would certainly make the
> streams work consistently between Python 2 and Python 3.
We could use codecs.open("latin-1") to allow for more
or less no text filtering. It might even work for our log
copying and filtering code. But we will use the ability to
diagnose newline mismatches in the error descriptions.

-- Stefan^2.
Received on 2016-05-13 19:43:04 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.