Use TypeError (fixes TRY004).
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index 2e50fbb..5c0a257 100644 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py
@@ -507,7 +507,7 @@ @staticmethod def _encodeable(path): if isinstance(path, bytes): - raise ValueError(f"Paths as bytes are no longer supported (got {path})") + raise TypeError(f"Paths as bytes are no longer supported (got {path!r})") try: return str(path).encode(sys.getfilesystemencoding()) except UnicodeEncodeError: