3862: Loading Patch hangs due to french local

msunde
What version are you running?
2.0.15

What's the URL of the page containing the problem?
http://review.XXXX/r/new/

What steps will reproduce the problem?
1. Select patch file to upload
2. Enter the directory for the diff
3. Stuck on loading screen.

What is the expected output? What do you see instead?
Expected to get to the new review request page so that I can fill in the rest of the information.

What operating system are you using? What browser?
Amazon linux.

Please provide any additional information below.

Here is what the patch file looks like:
-----------
Index: myPath/uIHM.pas
===================================================================
--- myPath/uIHM.pas	(révision 300)
+++ myPath/uIHM.pas	(copie de travail)
@@ -31501,7 +31501,7 @@
      Screen.Cursor := crHourGlass;
      lSlParams := TStringList.Create;
 
-     StartProgress(gContexte.MSG_Traduire('PATIENCE'), 0, 0, 0, 300, False);
+     StartProgress(gContexte.MSG_Traduire('PATIENCE1'), 0, 0, 0, 300, False);
 
      //Supprimer la liste précédente des prétickets
      {$IFDEF ADO}

-----------


The patch file works after I rename one field: révision --> revision

Changed:
--- myPath/uIHM.pas	(révision 300)
To:
--- myPath/uIHM.pas	(revision 300)



The error from the logs:

2015-05-05 15:42:33,038 - ERROR -  - Exception thrown for user XXXX at http://review.XXX/api/validation/diffs/

'utf8' codec can't decode byte 0xe9 in position 2: invalid continuation byte
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/core/handlers/base.py", line 112, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/views/decorators/cache.py", line 52, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Django-1.6.10-py2.6.egg/django/views/decorators/vary.py", line 19, in inner_func
    response = func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Djblets-0.8.16-py2.6.egg/djblets/webapi/resources.py", line 498, in __call__
    request, method, view, api_format=api_format, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Djblets-0.8.16-py2.6.egg/djblets/webapi/resources.py", line 569, in call_method_view
    return view(request, *args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Djblets-0.8.16-py2.6.egg/djblets/webapi/resources.py", line 751, in post
    return self.create(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Djblets-0.8.16-py2.6.egg/djblets/webapi/decorators.py", line 117, in _call
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python2.6/site-packages/ReviewBoard-2.0.15-py2.6.egg/reviewboard/webapi/decorators.py", line 110, in _check
    return view_func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Djblets-0.8.16-py2.6.egg/djblets/webapi/decorators.py", line 117, in _call
    return view_func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Djblets-0.8.16-py2.6.egg/djblets/webapi/decorators.py", line 138, in _checklogin
    return view_func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Djblets-0.8.16-py2.6.egg/djblets/webapi/decorators.py", line 117, in _call
    return view_func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Djblets-0.8.16-py2.6.egg/djblets/webapi/decorators.py", line 117, in _call
    return view_func(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/Djblets-0.8.16-py2.6.egg/djblets/webapi/decorators.py", line 287, in _validate
    return view_func(*args, **new_kwargs)
  File "/usr/local/lib/python2.6/site-packages/ReviewBoard-2.0.15-py2.6.egg/reviewboard/webapi/resources/validate_diff.py", line 144, in create
    save=False)
  File "/usr/local/lib/python2.6/site-packages/ReviewBoard-2.0.15-py2.6.egg/reviewboard/diffviewer/managers.py", line 156, in create_from_upload
    save=save)
  File "/usr/local/lib/python2.6/site-packages/ReviewBoard-2.0.15-py2.6.egg/reviewboard/diffviewer/managers.py", line 180, in create_from_data
    check_existence=(not parent_diff_file_contents)))
  File "/usr/local/lib/python2.6/site-packages/ReviewBoard-2.0.15-py2.6.egg/reviewboard/diffviewer/managers.py", line 277, in _process_files
    for f in parser.parse():
  File "/usr/local/lib/python2.6/site-packages/ReviewBoard-2.0.15-py2.6.egg/reviewboard/diffviewer/parser.py", line 57, in parse
    next_linenum, new_file = self.parse_change_header(i)
  File "/usr/local/lib/python2.6/site-packages/ReviewBoard-2.0.15-py2.6.egg/reviewboard/diffviewer/parser.py", line 132, in parse_change_header
    file.origInfo = file.origInfo.decode('utf-8')
  File "/usr/lib64/python2.6/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 2: invalid continuation byte
#1 msunde
The patch file in question was generated on a windows machine configured with a french local using TurtoiseSVN. It looks like this changed the SVN keywords that are appearing in the patch file.
brennie
#2 brennie
Could you attach the patch file? We don't need the entire patch file, just the part that includes the revision headers, e.g. this part:

Index: myPath/uIHM.pas
===================================================================
--- myPath/uIHM.pas	(révision 300)
+++ myPath/uIHM.pas	(copie de travail)

We need this to check the encoding of the file, because I can't reproduce this with a file encoded as UTF-8.

In the mean time, if you use rbt to generate and post the diff (e.g., with rbt diff), it should work as expected as it will use an English locale.
  • +NeedInfo
#3 ex***@dps-on******* (Google Code) (Is this you? Claim this profile.)
I get a slightly different error for patch files generated by TortoisSVN with german locale. The diff file header contains the revision stamp '(Arbeitskopie)'.
While uploading this patch file I will get a message 'Unable to parse diff...', see screenshot.

The file is properly encoded and the header conatins no special characters. I can fix the problem by simply replacing '(Arbeitskopie)' with '(working copy)'.

Maybe this was introduced by a recent change in Reviewboard. e upgraded from 2.015 to 2.0.17 recently and I don't remember exeriencing this problem before.
brennie
#4 brennie
Thanks for the information, exner. The German translation for "(working copy)" will make it in to 2.0.18. However, your issue is unrelated to this issue.
#5 msunde
It looks like the patch file was encoded using ISO 8859-1. Looking at the
repo,  many of the files are encoded that way instead of utf-8. There is
actually a mix of encodings in the repo.