Skip to content
Myr

Expect alternate errors in test_file_surrogates()

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

Not all file systems trigger a FileNotFoundError when encountering surrogates. Inside Podman the file system triggers an `OSError: [Errno 84] Illegal byte sequence: '\udcff'`.

authored by Jean-Louis Fuchs · committed by Jean-Louis Fuchs · parent 2d610e3 · Browse files · 1 file+6 added−1 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+6 added−1 removed

  • tests:+6 added−1 removed

1 file+6 added−1 removed

modified:tests/test_types.py+6 added-1 removed
224 unmodified lines
225)226def test_file_surrogates(type, tmp_path):227 path = tmp_path / "\udcff"228229 # - common case: �': No such file or directory230 # - special case: Illegal byte sequence231 # The spacial case is seen with rootless Podman. The root cause is most232 # likely that the path is handled by a user-space program (FUSE).233 match = r"(�': No such file or directory|Illegal byte sequence)"229 with pytest.raises(click.BadParameter, match="�': No such file or directory"):234 with pytest.raises(click.BadParameter, match=match):235 type.convert(path, None, None)236237238def test_file_error_surrogates():
19 unmodified lines