Bug 1058167

Summary: "git review --setup" failed in Chinese locale
Product: [Fedora] Fedora Reporter: Peng Wu <pwu>
Component: git-reviewAssignee: Pete Zaitcev <zaitcev>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: i, pwu, wmeier, zaitcev
Target Milestone: ---Keywords: FutureFeature, Tracking
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: git-review-1.24-1.fc21 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-31 05:30:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Peng Wu 2014-01-27 07:06:28 UTC
Description of problem:
My laptop use Chinese language, and I en-counter a bug when run "git review --setup" for openstack nova git repo.


Version-Release number of selected component (if applicable):
git-review-1.22-1.fc20.noarch

How reproducible:
clone the openstack nova project git repo, run "git review --setup".


Steps to Reproduce:
1. Use the Simplified Chinese locale for the desktop.
2. clone the openstack nova project git repo.
3. run "git review --setup".

Actual results:
To trigger this problem in English Desktop, please use the environment variables below to trigger the bug.

[nova]$ LANG=zh_CN.UTF-8  LC_ALL=zh_CN.UTF-8 git review --setup
Traceback (most recent call last):
  File "/usr/bin/git-review", line 1187, in <module>
    print(e)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 180-183: ordinal not in range(128)

and to print the error log, I use python3 to run git-review tool, see below:

[nova]$ LANG=zh_CN.UTF-8  LC_ALL=zh_CN.UTF-8 python3 /usr/bin/git-review --setup
Problems encountered installing commit-msg hook
The following command failed with exit code 1
    "scp -P None :hooks/commit-msg .git/hooks/commit-msg"
-----------------------
cp: 无法获取":hooks/commit-msg" 的文件状态(stat): 没有那个文件或目录
-----------------------


Expected results:
run "git review --setup" successfully without error.
[nova]$ git-review --setup
[nova]$ 


Additional info:

Comment 1 Christopher Meng 2014-02-06 13:54:51 UTC
Doesn't support ascii chars still.

Comment 2 Bill Meier 2014-02-12 03:58:02 UTC
FWIW: I get a similar error as follows:


UnicodeEncodeError: 'ascii' codec can't encode character u'\u2018' in position 192: ordinal not in range(128)

Running with python3, I see that the message is:

  The following command failed with exit code 1
      "scp -P None :hooks/commit-msg .git/hooks/commit-msg"
  -----------------------
  cp: cannot stat ‘:hooks/commit-msg’: No such file or directory


In this case: the error occurs for the ‘ (0x2018: left single quote) character (and presumably for the ’ (0x2019: right singe quote) character).

LANG=en_US.UTF-8

git-review.noarch  1.22-1.fc20

python.i686       2.7.5-9.fc20
python3.i686      3.3.2-8.fc20

Comment 3 Pete Zaitcev 2014-10-30 00:41:20 UTC
Although it was fixed in 1.23, I was unable to package that due to
regressions. This is finally fixed in 1.24, please verify.

Comment 4 Peng Wu 2014-10-31 05:14:27 UTC
I tried git-review 1.24 on Fedora 20, it seems work now.

$ rpm -q git-review
git-review-1.24-1.fc20.noarch
$ git review --setup

Comment 5 Pete Zaitcev 2014-10-31 05:30:58 UTC
Thanks, closing.