changeset 49601:8009a89bc18b

cffi: fix a bytes vs str issue on macOS when listing directories This code hasn't been touched in recent years, and the other implementation return bytes for the filename, so I assume this is a holdover from the py2 days. I was unable to test it on mac though, because the `_osutil` import failed.
author Matt Harbison <matt_harbison@yahoo.com>
date Tue, 08 Nov 2022 18:05:19 -0500
parents b6fc602e074a
children 78ba41878f2e
files mercurial/cffi/osutil.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cffi/osutil.py	Tue Nov 08 14:31:10 2022 -0500
+++ b/mercurial/cffi/osutil.py	Tue Nov 08 18:05:19 2022 -0500
@@ -57,7 +57,7 @@
                 ofs = cur.name_info.attr_dataoffset
                 str_lgt = cur.name_info.attr_length
                 base_ofs = ffi.offsetof(b'val_attrs_t', b'name_info')
-                name = str(
+                name = bytes(
                     ffi.buffer(
                         ffi.cast(b"char*", cur) + base_ofs + ofs, str_lgt - 1
                     )