Mercurial > public > mercurial-scm > hg
comparison mercurial/win32.py @ 39719:255d1885c7f8
py3: resolve Unicode issues around `hg serve` on Windows
Presumably we're going to want to use CreateProcessW(), and possibly get rid of
pycompat.getcwd() here (which maps to the DeprecationWarning causing
os.getcwdb()) to use os.getcwd() directly. But this was a minimal change to
get rid of some stacktraces in test-run-tests.t.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Wed, 19 Sep 2018 23:54:16 -0400 |
parents | f3900f4c63d4 |
children | edaa40dc5fe5 |
comparison
equal
deleted
inserted
replaced
39718:ac32685011a3 | 39719:255d1885c7f8 |
---|---|
577 env += "%s=%s\0" % (k, encoding.environ[k]) | 577 env += "%s=%s\0" % (k, encoding.environ[k]) |
578 if not env: | 578 if not env: |
579 env = '\0' | 579 env = '\0' |
580 env += '\0' | 580 env += '\0' |
581 | 581 |
582 args = subprocess.list2cmdline(args) | 582 args = subprocess.list2cmdline(pycompat.rapply(encoding.strfromlocal, args)) |
583 | 583 |
584 # TODO: CreateProcessW on py3? | |
584 res = _kernel32.CreateProcessA( | 585 res = _kernel32.CreateProcessA( |
585 None, args, None, None, False, _CREATE_NO_WINDOW, | 586 None, encoding.strtolocal(args), None, None, False, _CREATE_NO_WINDOW, |
586 env, pycompat.getcwd(), ctypes.byref(si), ctypes.byref(pi)) | 587 env, pycompat.getcwd(), ctypes.byref(si), ctypes.byref(pi)) |
587 if not res: | 588 if not res: |
588 raise ctypes.WinError() | 589 raise ctypes.WinError() |
589 | 590 |
590 return pi.dwProcessId | 591 return pi.dwProcessId |