# HG changeset patch # User Matt Harbison # Date 1537756604 14400 # Node ID fb628c048d64b011765bd0b601f628804d04e89d # Parent 24e493ec222940123642f4dfcb8b3e5f0248d546 py3: don't use os.getcwdb() on Windows to avoid DeprecationWarnings See also ac32685011a3. diff -r 24e493ec2229 -r fb628c048d64 mercurial/encoding.py --- a/mercurial/encoding.py Fri Sep 21 19:48:23 2018 -0400 +++ b/mercurial/encoding.py Sun Sep 23 22:36:44 2018 -0400 @@ -236,7 +236,12 @@ if pycompat.ispy3: # os.getcwd() on Python 3 returns string, but it has os.getcwdb() which # returns bytes. - getcwd = os.getcwdb # re-exports + if pycompat.iswindows: + # Python 3 on Windows issues a DeprecationWarning about using the bytes + # API when os.getcwdb() is called. + getcwd = lambda: strtolocal(os.getcwd()) # re-exports + else: + getcwd = os.getcwdb # re-exports else: getcwd = os.getcwd # re-exports