Skip to content

Commit e2db9b5

Browse files
adamtheturtleclaude
andcommitted
Remove unnecessary .encode() on error paths in VuMark endpoint
Return exc.response_text as str (consistent with all other endpoints) instead of encoding to bytes on error paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a24762c commit e2db9b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/mock_vws/_requests_mock_server/mock_web_services_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -747,15 +747,15 @@ def generate_vumark_instance(
747747
databases=self._target_manager.databases,
748748
)
749749
except ValidatorError as exc:
750-
return exc.status_code, exc.headers, exc.response_text.encode()
750+
return exc.status_code, exc.headers, exc.response_text
751751

752752
# Validate Accept header
753753
try:
754754
accept_header = validate_accept_header(
755755
request_headers=request.headers,
756756
)
757757
except ValidatorError as exc:
758-
return exc.status_code, exc.headers, exc.response_text.encode()
758+
return exc.status_code, exc.headers, exc.response_text
759759

760760
# Extract and validate instance_id from request body
761761
request_json: dict[str, Any] = json.loads(s=request.body or b"{}")
@@ -764,7 +764,7 @@ def generate_vumark_instance(
764764
instance_id=request_json.get("instance_id"),
765765
)
766766
except ValidatorError as exc:
767-
return exc.status_code, exc.headers, exc.response_text.encode()
767+
return exc.status_code, exc.headers, exc.response_text
768768

769769
# Generate the appropriate image format
770770
if accept_header == "image/svg+xml":

0 commit comments

Comments
 (0)