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