typing: fix the hint for the `mode` argument of `platform.copymode()`
The posix module is doing a bitwise AND with this and an integer, so it can't be
bytes. The only caller that provides the argument is `util.mktempcopy()`, and
pytype infers the type as Any, which explains why this wasn't caught.
--- a/mercurial/posix.py Fri May 05 06:08:36 2023 -0600
+++ b/mercurial/posix.py Sat Aug 10 14:18:44 2024 -0400
@@ -213,7 +213,7 @@
def copymode(
src: bytes,
dst: bytes,
- mode: Optional[bytes] = None,
+ mode: Optional[int] = None,
enforcewritable: bool = False,
) -> None:
"""Copy the file mode from the file at path src to dst.
--- a/mercurial/windows.py Fri May 05 06:08:36 2023 -0600
+++ b/mercurial/windows.py Sat Aug 10 14:18:44 2024 -0400
@@ -297,7 +297,7 @@
def copymode(
src: bytes,
dst: bytes,
- mode: Optional[bytes] = None,
+ mode: Optional[int] = None,
enforcewritable: bool = False,
) -> None:
pass