diff options
| author | Dāvis Mosāns <davispuh@gmail.com> | 2016-07-16 21:11:11 +0300 |
|---|---|---|
| committer | Dāvis Mosāns <davispuh@gmail.com> | 2016-07-16 22:10:06 +0300 |
| commit | 631d0ec708b5341ba02b821c120755fd814fbc0b (patch) | |
| tree | 53c234d1a176959e0e0cfc13ffca44d8a636e6a4 | |
| parent | f97e72e5ddfcd34400aba384775b793170044f5c (diff) | |
| download | git-repo-631d0ec708b5341ba02b821c120755fd814fbc0b.tar.gz | |
Support non-ASCII GNUPGHOME environment variable
Here we don't need to encode this gpg_dir string when using
Python 2.7 on Linux.
Change-Id: I56724e9511d3b1aea61535e654a45c212130630d
| -rwxr-xr-x | repo | 10 |
1 files changed, 8 insertions, 2 deletions
| @@ -432,7 +432,10 @@ def SetupGnuPG(quiet): | |||
| 432 | sys.exit(1) | 432 | sys.exit(1) |
| 433 | 433 | ||
| 434 | env = os.environ.copy() | 434 | env = os.environ.copy() |
| 435 | env['GNUPGHOME'] = gpg_dir.encode() | 435 | try: |
| 436 | env['GNUPGHOME'] = gpg_dir | ||
| 437 | except UnicodeEncodeError: | ||
| 438 | env['GNUPGHOME'] = gpg_dir.encode() | ||
| 436 | 439 | ||
| 437 | cmd = ['gpg', '--import'] | 440 | cmd = ['gpg', '--import'] |
| 438 | try: | 441 | try: |
| @@ -638,7 +641,10 @@ def _Verify(cwd, branch, quiet): | |||
| 638 | _print(file=sys.stderr) | 641 | _print(file=sys.stderr) |
| 639 | 642 | ||
| 640 | env = os.environ.copy() | 643 | env = os.environ.copy() |
| 641 | env['GNUPGHOME'] = gpg_dir.encode() | 644 | try: |
| 645 | env['GNUPGHOME'] = gpg_dir | ||
| 646 | except UnicodeEncodeError: | ||
| 647 | env['GNUPGHOME'] = gpg_dir.encode() | ||
| 642 | 648 | ||
| 643 | cmd = [GIT, 'tag', '-v', cur] | 649 | cmd = [GIT, 'tag', '-v', cur] |
| 644 | proc = subprocess.Popen(cmd, | 650 | proc = subprocess.Popen(cmd, |
