equal
deleted
inserted
replaced
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 |