FAILURE MAP
← Case archive

FA-3276 / Encodings / Open access

A form plus sign remains literal · case 01

A form plus sign remains literal.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The implementation applies an operation whose text or grammar semantics violate this contract: Decode form text: plus becomes space before percent-decoding UTF-8.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: Decode form text: plus becomes space before percent-decoding UTF-8.

Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.

Case contract

Decode form text: plus becomes space before percent-decoding UTF-8.

Why this case matters

A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return unquote(x)
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('a+b'), 'a b')
check('boundary 2', solve('a%2Bb'), 'a+b')
check('boundary 3', solve('%2520'), '%20')
check('boundary 4', solve('caf%C3%A9'), 'café')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1a+ba bFailed
boundary 2a+ba+bPassed
boundary 3%20%20Passed
boundary 4cafécaféPassed

SHA-256 / b2c6cb6ae47ba6f4c91ff044e3f73df8e3e4e8e5f0bc28a856526f268f184175

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return unquote(x).replace('+',' ')
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('a+b'), 'a b')
check('boundary 2', solve('a%2Bb'), 'a+b')
check('boundary 3', solve('%2520'), '%20')
check('boundary 4', solve('caf%C3%A9'), 'café')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1a ba bPassed
boundary 2a ba+bFailed
boundary 3%20%20Passed
boundary 4cafécaféPassed

SHA-256 / 6156eb33b5aa984bf2ff0f79192e281eea03bcb98ef014695ac4ea9d0d9266b9

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return unquote(x.replace('+',' '))
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('a+b'), 'a b')
check('boundary 2', solve('a%2Bb'), 'a+b')
check('boundary 3', solve('%2520'), '%20')
check('boundary 4', solve('caf%C3%A9'), 'café')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1a ba bPassed
boundary 2a+ba+bPassed
boundary 3%20%20Passed
boundary 4cafécaféPassed

SHA-256 / 14d64437824ad3c0e3860202d220283aeac9baa862b8f0978212ca663f952cdf

Verification & scope

This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:37:23.530097+00:00.

Case digest / 9b88628e425dfb54a64f57170aadf59acf9889b62fbbe4cde3ee610093f76e34