Skip to content
Myr

Accept ZFS error-message for non-UTF-8 names (#3526)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Rowlando13 · committed by GitHub · parents 97210f2, 9f9ae45 · Browse files · 1 file+15 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+15 added−6 removed

  • tests:+15 added−6 removed

1 file+15 added−6 removed

modified:tests/test_types.py+15 added-6 removed
241 unmodified lines
242 click.File(mode="r", lazy=True),243 ],244)245def test_file_surrogates(type, tmp_path):246 path = tmp_path / "\udcff"246 """Ensures that the error handling in ``click.File`` is robust.247248 # - common case: �': No such file or directory249 # - special case: Illegal byte sequence250 # The special case is seen with rootless Podman. The root cause is most251 # likely that the path is handled by a user-space program (FUSE).252 match = r"(�': No such file or directory|Illegal byte sequence)"248 ``EILSEQ`` shows up with rootless Podman (FUSE-backed paths) and on filesystems249 that reject non-UTF-8 names, like ZFS with ``utf8only=on``.250251 See: https://github.com/pallets/click/issues/2634252 """253 path = tmp_path / "\udcff"254 match = (255 # Common case: �': No such file or directory.256 r"(�': No such file or directory"257 # BSD/macOS libc special case (EILSEQ).258 r"|Illegal byte sequence"259 # glibc special case (EILSEQ).260 r"|Invalid or incomplete multibyte or wide character)"261 )262 with pytest.raises(click.BadParameter, match=match):263 type.convert(path, None, None)264265
20 unmodified lines