diff --git a/src/packaging/specifiers.py b/src/packaging/specifiers.py index 1f3adaf6..b30926af 100644 --- a/src/packaging/specifiers.py +++ b/src/packaging/specifiers.py @@ -234,7 +234,7 @@ def __init__(self, spec: str = "", prereleases: bool | None = None) -> None: """ match = self._regex.search(spec) if not match: - raise InvalidSpecifier(f"Invalid specifier: '{spec}'") + raise InvalidSpecifier(f"Invalid specifier: {spec!r}") self._spec: tuple[str, str] = ( match.group("operator").strip(), diff --git a/src/packaging/utils.py b/src/packaging/utils.py index 291b32cd..23450953 100644 --- a/src/packaging/utils.py +++ b/src/packaging/utils.py @@ -125,7 +125,7 @@ def parse_wheel_filename( build_match = _build_tag_regex.match(build_part) if build_match is None: raise InvalidWheelFilename( - f"Invalid build number: {build_part} in '{filename!r}'" + f"Invalid build number: {build_part} in {filename!r}" ) build = cast(BuildTag, (int(build_match.group(1)), build_match.group(2))) else: diff --git a/src/packaging/version.py b/src/packaging/version.py index 233dd4d0..c9bbda20 100644 --- a/src/packaging/version.py +++ b/src/packaging/version.py @@ -199,7 +199,7 @@ def __init__(self, version: str) -> None: # Validate the version and parse it into pieces match = self._regex.search(version) if not match: - raise InvalidVersion(f"Invalid version: '{version}'") + raise InvalidVersion(f"Invalid version: {version!r}") # Store the parsed out pieces of the version self._version = _Version(