mercurial/win32.py
changeset 7948 de377b1a9a84
parent 7890 e710f0f592b2
child 8225 46293a0c7e9f
equal deleted inserted replaced
7947:a454eeb1b827 7948:de377b1a9a84
    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'''