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

Re: svn commit: r1743236 - in /subversion/trunk/subversion/tests/cmdline: merge_tests.py svntest/actions.py svntest/tree.py

From: Stefan Fuhrmann <stefan2_at_apache.org>
Date: Fri, 13 May 2016 05:26:59 +0200

On 12.05.2016 23:49, Evgeny Kotkov wrote:
> Stefan Fuhrmann <stefan2_at_apache.org> writes:
>
>> * subversion/tests/cmdline/svntest/actions.py
>> (set_prop): If we write a bytes string to a prop, treat it as binary
>> that can't be passed directly via command line argument.
> [...]
>
>> - if value and (value[0] == '-' or '\x00' in value or sys.platform == 'win32'):
>> + if value and (isinstance(value, bytes) or
>> + (value[0] == '-' or '\x00' in value or sys.platform == 'win32')):
>> from tempfile import mkstemp
>> (fd, value_file_path) = mkstemp()
>> os.close(fd)
> The new condition looks fairly suspicious.
Sure, but no worse than before.
> What if someone calls set_prop('foo', '-') under Python 3? Or something like
> set_prop('foo', 'bar'), but on Windows with Python 3? Is it going to raise
> an error, because we'd try to pass a string to file.write() that expects
> bytes?
Right now this is not a problem with all tests passing
under Linux and the Windows tests being fundamentally
broken. If you have a good idea how to improve that
code, please go ahead and patch it.

-- Stefan^2.
Received on 2016-05-13 05:27:02 CEST

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