py3: don't use os.getcwdb() on Windows to avoid DeprecationWarnings
See also
ac32685011a3.
--- 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