1

I get an error when I try to submit my code to gerrit using gitbash on windows. The error is as below:

$ git review
You are about to submit multiple commits. This is expected if you are
submitting a commit that is dependent on one or more in-review
commits. Otherwise you should consider squashing your changes into one
commit before submitting.
Traceback (most recent call last):
  File "c:\Python33\Scripts\git-review-script.py", line 9, in <module>
    load_entry_point('git-review==1.24', 'console_scripts', 'git-review')()
  File "C:\Python33\lib\site-packages\git_review\cmd.py", line 1214, in main
    assert_one_change(remote, branch, yes, have_hook)
  File "C:\Python33\lib\site-packages\git_review\cmd.py", line 718, in assert_on
e_change
    "Do you really want to submit the above commits?" % output)
  File "C:\Python33\lib\encodings\cp850.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_map)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u2026' in position
8042: character maps to <undefined>

The process aborts post the error message. Also the git-review version is as below:

$ git review --version
git-review-script.py version 1.24

Also the git version on my windows machine is:

git version 1.9.4.msysgit.1

I badly need help or any clue on how to get this working.

The character encoding showing on my cmd.exe is 850

fracz
  • 20,536
  • 18
  • 103
  • 149
Jagori
  • 229
  • 1
  • 3
  • 11
  • Does one of the commit messages contain a HORIZONTAL ELLIPSIS (U+2026) character? Can you just replace it with "..."? – Magnus Bäck Sep 08 '14 at 05:45

1 Answers1

4

Try to install Python 2.7.* and launch git review with it. I also had problems with running git-review on Python 3.* although authors claim that it is supported.


By investigating your problem in detail I noticed that the problem is with \u2026 character (that is horizontal ellipsis - …). Python is known to have problems with decoding it.

As a temporary fix, please reword your commit messages not to contain problematic characters (replace … with three dots).

You may also use command git review -y to skip displaying the confirmation (thus the error message too).


I have created a bug report for git-review.

Community
  • 1
  • 1
fracz
  • 20,536
  • 18
  • 103
  • 149
  • Thanks,I tried with Python 2.7 too but it is not helping.Shows the same error with python 2.7 instead of 3.3.I reinstalled git review by uninstalling the latest version and then through installing get-pip.py .But this too not helped.Any suggestions more on this..I am stuck with this.I don't know till last few months it worked,recently I had upgraded git review to 1.24 .Although the git review -s command works but it's only when am trying to push my code to gerrit for code review via git review -R command it fails with the above message. – Jagori Sep 06 '14 at 08:53
  • Hi!Thanks so much for your reply.This was indeed useful.Although I couldnot locate any (...) character in my commit message but somehow I think my commit message was lengthy maybe which probably was causing the ellipsis to be introduced.Nonetheless what I did was I reworded my commit message as well as used git review -y.What does the git review -y command do?By that I mean the -y option? – Jagori Sep 09 '14 at 08:38
  • `-y` option tells git-review not to ask you for confirmation on sending multiple commits to gerrit at once. Because the problem was in displaying this confirmation, skipping it solves your issue. Run `git review -h` to find out more. – fracz Sep 09 '14 at 08:44
  • Thanks a lot.This was indeed helpful. – Jagori Sep 09 '14 at 13:13
  • yes. replace the Chinese chars, `git review` is working on win7. – Max May 16 '19 at 02:27