mercurial/encoding.py
changeset 39819 fb628c048d64
parent 39818 24e493ec2229
child 39839 9e8fcd2e78c1
equal deleted inserted replaced
39818:24e493ec2229 39819:fb628c048d64
   234                    for k, v in os.environ.items())  # re-exports
   234                    for k, v in os.environ.items())  # re-exports
   235 
   235 
   236 if pycompat.ispy3:
   236 if pycompat.ispy3:
   237     # os.getcwd() on Python 3 returns string, but it has os.getcwdb() which
   237     # os.getcwd() on Python 3 returns string, but it has os.getcwdb() which
   238     # returns bytes.
   238     # returns bytes.
   239     getcwd = os.getcwdb  # re-exports
   239     if pycompat.iswindows:
       
   240         # Python 3 on Windows issues a DeprecationWarning about using the bytes
       
   241         # API when os.getcwdb() is called.
       
   242         getcwd = lambda: strtolocal(os.getcwd())  # re-exports
       
   243     else:
       
   244         getcwd = os.getcwdb  # re-exports
   240 else:
   245 else:
   241     getcwd = os.getcwd  # re-exports
   246     getcwd = os.getcwd  # re-exports
   242 
   247 
   243 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide.
   248 # How to treat ambiguous-width characters. Set to 'wide' to treat as wide.
   244 _wide = _sysstr(environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"
   249 _wide = _sysstr(environ.get("HGENCODINGAMBIGUOUS", "narrow") == "wide"