[RFC] str versus bytes in subversion/tests/cmdline
From: Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA_at_GMail.Com>
Date: Tue, 31 Mar 2009 14:20:13 +0200
Python 3 contains major changes in handling of strings.
str type was renamed to bytes type. ("string" -> b"string")
I will use Python 3 names of these types in present e-mail.
In Python 2:
In Python 3:
Explicit encoding / decoding between these types is now required.
bytes.decode() returns str.
(bytes type doesn't support encode(). str type doesn't support decode().)
subversion/tests/cmdline tests use subprocess.Popen to obtain
Encoding / decoding doesn't work with invalid UTF-8 characters.
merge_tests.py 4 ("some simple property merges") test sets some
This problem has 2 solutions:
1. Internally store the output of commands in bytes type, perform some
Invalid UTF-8 characters would be still supported by
See the attached, unfinished patch (subversion-svntest-python-3.patch) for
2. Internally store the output of commands in str type, decode output
In this case merge_tests.py 4 test would have to be changed to no longer
See the attached patch (subversion-svntest-decode_subprocess_output.patch)
-- Arfrever Frehtes Taifersar Arahesis ------------------------------------------------------ http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1495347
|
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.