mercurial/encoding.py
changeset 46319 3dfebba99ef6
parent 45942 89a2afe31e82
child 46819 d4ba4d51f85f
equal deleted inserted replaced
46318:e74274fc1b35 46319:3dfebba99ef6
   296     # os.getcwd() on Python 3 returns string, but it has os.getcwdb() which
   296     # os.getcwd() on Python 3 returns string, but it has os.getcwdb() which
   297     # returns bytes.
   297     # returns bytes.
   298     if pycompat.iswindows:
   298     if pycompat.iswindows:
   299         # Python 3 on Windows issues a DeprecationWarning about using the bytes
   299         # Python 3 on Windows issues a DeprecationWarning about using the bytes
   300         # API when os.getcwdb() is called.
   300         # API when os.getcwdb() is called.
   301         getcwd = lambda: strtolocal(os.getcwd())  # re-exports
   301         #
       
   302         # Additionally, py3.8+ uppercases the drive letter when calling
       
   303         # os.path.realpath(), which is used on ``repo.root``.  Since those
       
   304         # strings are compared in various places as simple strings, also call
       
   305         # realpath here.  See https://bugs.python.org/issue40368
       
   306         getcwd = lambda: strtolocal(os.path.realpath(os.getcwd()))  # re-exports
   302     else:
   307     else:
   303         getcwd = os.getcwdb  # re-exports
   308         getcwd = os.getcwdb  # re-exports
   304 else:
   309 else:
   305     getcwd = os.getcwd  # re-exports
   310     getcwd = os.getcwd  # re-exports
   306 
   311