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

Re: [RFC] str versus bytes in subversion/tests/cmdline

From: Greg Stein <gstein_at_gmail.com>
Date: Wed, 1 Apr 2009 17:05:53 +0200

On Wed, Apr 1, 2009 at 15:04, Arfrever Frehtes Taifersar Arahesis
<Arfrever.FTA_at_gmail.com> wrote:
>...
>> 2. Internally store the output of commands in str type, decode output
>> of commands quickly after obtaining it from subprocess.Popen, convert
>> significantly smaller number of strings to bytes type and *ban invalid UTF-8
>> characters* in subversion/tests/cmdline.
>>
>> In this case merge_tests.py 4 test would have to be changed to no longer
>> set invalid UTF-8 characters in some properties.
>>
>> See the attached patch (subversion-svntest-decode_subprocess_output.patch)
>> for trunk which implements decoding of outpuf of commands.
>
> I have decided to implement the improved version of the second
> solution. svntest will try to store output of commands in str type,
> but will use bytes type for strings with invalid UTF-8 characters.
> bytes type will have to be used also when writing to files opened in
> binary mode.

"bytes type" ?? there is no b"foo" syntax in 2.4, so I don't even know
how you're going to start on this.

> subversion/tests/cmdline/svntest/wc.py:StateItem.tweak() will contain
> workaround for merge_tests.py 4. The properties set by merge_tests.py
> 4 (simple_property_merges()) will have bytes type. The expected output
> of error message with property values with invalid UTF-8 characters
> will depend on Python version.
>
> See the attached, unfinished patch (subversion-svntest-python-3-v2.patch).

It relies on the b"foo" syntax, so how could this be applied?

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1507836
Received on 2009-04-01 17:06:45 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.