input needs byte string as input to avoid UnicodeDecodeError.

Review Request #6975 — Created Feb. 24, 2015 and submitted — Latest diff uploaded

halvorlu
RBTools
master
da24725...
rbtools

input apparently needs byte string as input.

Unexpected errors occured if rbt post was to update a review request with unicode characters in the summary. This seems to be due to the fact that input() cannot take unicode strings as an argument.

The behavior can be tested by setting up a ReviewBoard server with a testrepo (path /home/user/repo) and running the following bash script:
Tested with the following bash script:

SERVER=http://localhost:8090/
hg clone testrepo clientrepo
cd clientrepo
echo "test" > tmp.txt
hg commit -m "ÆØÅæøå" -u "User æøå"
rbt post --server $SERVER --repository testrepo --username testuser --password password --debug
echo "bla3" > tmp.txt
hg commit -m "æææ" -u "øøø"
rbt post --server $SERVER --repository testrepo --username testuser --password password --debug -u

The second call to rbt post lead to a UnicodeDecodeError.

    Loading...