3969: Exception when rbt posting from svn if the diff contains non-ascii file names
- Fixed
- RBTools
stefan.bohne | |
What version are you running?
RBTools 0.7.4
What steps will reproduce the problem?
- Create a svn repo
- Commit something with non-ascii file names
- Post this as review request via rbt post
What is the expected output? What do you see instead?
I expect a review request being created without errors. I see an exception instead.
What operating system are you using?
Ubuntu 14.04
Attach the debug out from the command.
$ rbt post --publish --debug --user=xxx --password=yyy --server=http://reviews --repository-url=http://svn/svn/main/ --target-groups=CRBBBLACKSILO --target-people=xxx --description-file=/tmp/tmpvSF0WvcreateReviewForCommit --summary=longsummary --submit-as=xxx 11479
/usr/local/lib/python2.7/dist-packages/RBTools-0.7.4-py2.7.egg/rbtools/commands/main.py:101: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal elif opt.help or '--help' in args or '-h' in args: >>> RBTools 0.7.4 >>> Python 2.7.6 (default, Jun 22 2015, 18:00:18) [GCC 4.8.2] >>> Running on Linux-3.13.0-58-generic-i686-with-Ubuntu-14.04-trusty >>> Home = /home/stbohne >>> Current directory = /home/stbohne >>> Running: git version >>> Checking for a Subversion repository... >>> Running: svn --non-interactive info http://svn/svn/main/ >>> Running: diff --version >>> Running: svn --non-interactive --version -q >>> repository info: Path: http://svn/svn/main, Base path: /, Supports changesets: False >>> Making HTTP GET request to http://reviews/api/ >>> Making HTTP GET request to http://reviews/api/repositories/ >>> Cached response for HTTP GET http://reviews/api/repositories/ expired and was modified >>> Making HTTP GET request to http://reviews/api/repositories/1/info/ >>> Cached response for HTTP GET http://reviews/api/repositories/1/info/ expired and was modified >>> repository info: Path: http://svn/svn/main, Base path: /, Supports changesets: False >>> Running: svn --non-interactive log --xml -r 11479 -l 1 http://svn/svn/main/ >>> Running: svn --non-interactive info http://svn/svn/main/ >>> Running: diff --version >>> Running: svn --non-interactive --version -q >>> repository info: Path: http://svn/svn/main, Base path: /, Supports changesets: False >>> Running: svn --non-interactive status -q --ignore-externals >>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry http://svn/svn/main/@11478 http://svn/svn/main/@11479 >>> Running: svn --non-interactive diff --diff-cmd=diff --notice-ancestry http://svn/svn/main/@11478 http://svn/svn/main/@11479 --no-diff-deleted Traceback (most recent call last): File "/usr/local/bin/rbt", line 9, in <module> load_entry_point('RBTools==0.7.4', 'console_scripts', 'rbt')() File "/usr/local/lib/python2.7/dist-packages/RBTools-0.7.4-py2.7.egg/rbtools/commands/main.py", line 133, in main command.run_from_argv([RB_MAIN, command_name] + args) File "/usr/local/lib/python2.7/dist-packages/RBTools-0.7.4-py2.7.egg/rbtools/commands/__init__.py", line 612, in run_from_argv exit_code = self.main(*args) or 0 File "/usr/local/lib/python2.7/dist-packages/RBTools-0.7.4-py2.7.egg/rbtools/commands/post.py", line 691, in main extra_args=extra_args) File "/usr/local/lib/python2.7/dist-packages/RBTools-0.7.4-py2.7.egg/rbtools/clients/svn.py", line 365, in diff 'diff': b''.join(diff), UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15: ordinal not in range(128)Please provide any additional information below.
I tracked this down to rbtools/clients/svn.py line 626 in
SVNClient.convert_to_absolute_paths
. There,repository_info.base_path
is a unicode string (justu'/'
in my case). This unicode-ness is then propagated such that the result ofconvert_to_absolute_paths
containsunicode
andstr
. This then leads to theUnicodeDecodeError
when the non-unicode strings contain non-ascii characters.