tortoisehg / stable (http://tortoisehg.bitbucket.org/)
TortoiseHg repository. Main line of development in "default" branch. Releases, bugfixes, and documentation improvements in "stable" branch.
Clone this repository (size: 23.9 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/tortoisehg/stable/
| commit 3071: | 73aee702785a |
| parent 3070: | 63738fddd906 |
| branch: | default |
contrib/win32: encode unicode paths for use with environment variables
os.environ expects str instances and will try to convert the unicode
strings to native strings, causing paths with non-ascii characters to
crash any hgtk operation.
Changed (Δ214 bytes):
raw changeset »
contrib/win32/config.py (8 lines added, 0 lines removed)
Up to file-list contrib/win32/config.py:
| … | … | @@ -12,6 +12,7 @@ of the GNU General Public License, incor |
12 |
12 |
# current executable to find our package data. |
13 |
13 |
|
14 |
14 |
import os |
15 |
import sys |
|
15 |
16 |
import win32api, win32process |
16 |
17 |
|
17 |
18 |
proc = win32api.GetCurrentProcess() |
| … | … | @@ -25,3 +26,10 @@ bin_path = os.path.dirname(procpath) |
25 |
26 |
license_path = os.path.join(bin_path, 'COPYING.txt') |
26 |
27 |
locale_path = os.path.join(bin_path, 'locale') |
27 |
28 |
icon_path = os.path.join(bin_path, 'icons') |
29 |
||
30 |
enc = sys.getfilesystemencoding() |
|
31 |
if enc: |
|
32 |
bin_path = bin_path.encode(enc) |
|
33 |
license_path = license_path.encode(enc) |
|
34 |
locale_path = locale_path.encode(enc) |
|
35 |
icon_path = icon_path.encode(enc) |
