FAILURE MAP
← Case archive

FA-2891 / Unicode / Open access

A nonbreaking space is not recognized as whitespace · case 01

A nonbreaking space is not recognized as whitespace.

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: True exactly for nonempty Unicode whitespace strings.

VERIFIED REPAIR

Implement the complete stated contract, including the boundary fixtures: True exactly for nonempty Unicode whitespace strings.

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

Case contract

True exactly for nonempty Unicode whitespace strings.

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 bool(x) and all(c in ' \x09\r\n' for c in 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('\xa0'), True)
check('boundary 2', solve(''), False)
check('boundary 3', solve('\u2028\t'), True)
check('boundary 4', solve('x'), False)
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 1FalseTrueFailed
boundary 2FalseFalsePassed
boundary 3FalseTrueFailed
boundary 4FalseFalsePassed

SHA-256 / bcf84c02f95bf70a83556f3bd48f81d093e70c5a7254149570cb11bef3943404

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 all(c.isspace() for c in 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('\xa0'), True)
check('boundary 2', solve(''), False)
check('boundary 3', solve('\u2028\t'), True)
check('boundary 4', solve('x'), False)
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 1TrueTruePassed
boundary 2TrueFalseFailed
boundary 3TrueTruePassed
boundary 4FalseFalsePassed

SHA-256 / c85410689e8ea7bec4ce3c36767185b2a77b12cebd9bc26a14441ae3304d304f

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 x.isspace()
    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('\xa0'), True)
check('boundary 2', solve(''), False)
check('boundary 3', solve('\u2028\t'), True)
check('boundary 4', solve('x'), False)
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 1TrueTruePassed
boundary 2FalseFalsePassed
boundary 3TrueTruePassed
boundary 4FalseFalsePassed

SHA-256 / df3dfb3b8f80ca9e7920ea8e7fea5a063e02aafaa817e961219f749b7e9a6d12

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:18.558306+00:00.

Case digest / eb6a83ee882a0b38ac9d31947c6dbbf0ce6bc6f6431cc3ff9148607d0d21dfa7