You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Evgeny Kotkov <ev...@visualsvn.com> on 2016/05/10 15:59:46 UTC

Re: svn commit: r1743217 - in /subversion/trunk/subversion/tests/cmdline: svnadmin_tests.py svntest/main.py

Stefan Fuhrmann <st...@apache.org> writes:

>   (patch_format,
>    is_sharded): The format file is easiest handled as plain text.

[...]

>    format_path = os.path.join(repo_dir, "db", "format")
> -  contents = open(format_path, 'rb').read()
> +  contents = open(format_path, 'r').read()
>    processed_lines = []
>
>    for line in contents.split("\n"):
> @@ -247,13 +247,13 @@ def patch_format(repo_dir, shard_size):
>
>    new_contents = "\n".join(processed_lines)
>    os.chmod(format_path, svntest.main.S_ALL_RW)
> -  open(format_path, 'wb').write(new_contents)
> +  open(format_path, 'w').write(new_contents)

On Windows, opening files as text is going to perform additional LF/CRLF
translation, so this is probably going to produce corrupted `format' files.


Regards,
Evgeny Kotkov

Re: svn commit: r1743217 - in /subversion/trunk/subversion/tests/cmdline: svnadmin_tests.py svntest/main.py

Posted by Stefan Fuhrmann <st...@apache.org>.
On 10.05.2016 17:59, Evgeny Kotkov wrote:
> Stefan Fuhrmann <st...@apache.org> writes:
>
>>    (patch_format,
>>     is_sharded): The format file is easiest handled as plain text.
> [...]
>
>>     format_path = os.path.join(repo_dir, "db", "format")
>> -  contents = open(format_path, 'rb').read()
>> +  contents = open(format_path, 'r').read()
>>     processed_lines = []
>>
>>     for line in contents.split("\n"):
>> @@ -247,13 +247,13 @@ def patch_format(repo_dir, shard_size):
>>
>>     new_contents = "\n".join(processed_lines)
>>     os.chmod(format_path, svntest.main.S_ALL_RW)
>> -  open(format_path, 'wb').write(new_contents)
>> +  open(format_path, 'w').write(new_contents)
> On Windows, opening files as text is going to perform additional LF/CRLF
> translation, so this is probably going to produce corrupted `format' files.
That is correct. Fixed in r1743217.

-- Stefan^2.