equal
deleted
inserted
replaced
14 |
14 |
15 import win32api |
15 import win32api |
16 |
16 |
17 import errno, os, sys, pywintypes, win32con, win32file, win32process |
17 import errno, os, sys, pywintypes, win32con, win32file, win32process |
18 import cStringIO, winerror |
18 import cStringIO, winerror |
19 import osutil |
19 import osutil, encoding |
20 import util |
20 import util |
21 from win32com.shell import shell,shellcon |
21 from win32com.shell import shell,shellcon |
22 |
22 |
23 class WinError(Exception): |
23 class WinError(Exception): |
24 winerror_map = { |
24 winerror_map = { |
211 scope = (scope,) |
211 scope = (scope,) |
212 for s in scope: |
212 for s in scope: |
213 try: |
213 try: |
214 val = QueryValueEx(OpenKey(s, key), valname)[0] |
214 val = QueryValueEx(OpenKey(s, key), valname)[0] |
215 # never let a Unicode string escape into the wild |
215 # never let a Unicode string escape into the wild |
216 return util.tolocal(val.encode('UTF-8')) |
216 return encoding.tolocal(val.encode('UTF-8')) |
217 except EnvironmentError: |
217 except EnvironmentError: |
218 pass |
218 pass |
219 |
219 |
220 def system_rcpath_win32(): |
220 def system_rcpath_win32(): |
221 '''return default os-specific hgrc search path''' |
221 '''return default os-specific hgrc search path''' |