Skip to content

asText survives parseFilter output: to_unicode instead of .decode() (fixes #248) - #259

Merged
psi29a merged 2 commits into
masterfrom
fixes/batch6
Aug 25, 2026
Merged

asText survives parseFilter output: to_unicode instead of .decode() (fixes #248)#259
psi29a merged 2 commits into
masterfrom
fixes/batch6

Conversation

@psi29a

@psi29a psi29a commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

asText survives parseFilter output: to_unicode instead of .decode() (fixes #248)

parseFilter builds LDAPFilter_* objects whose .value fields are str, because pyparsing hands us str. Every asText path in pureldap called .value.decode() unconditionally, which crashed with AttributeError: 'str' object has no attribute 'decode' the moment a caller tried to render a parsed filter (rather than a wire-decoded one). Route the ten remaining sites through to_unicode so both origins work. Regression test covers equality, presence, substring, approxMatch, greater/lessOrEqual and extensibleMatch.

Full suite green on py3.11 / 3.13 / 3.14.

psi29a and others added 2 commits August 25, 2026 16:03
…ixes #248)

parseFilter builds LDAPFilter_* objects whose .value fields are str,
because pyparsing hands us str. Every asText path in pureldap called
.value.decode() unconditionally, which crashed with
AttributeError: 'str' object has no attribute 'decode' the moment a
caller tried to render a parsed filter (rather than a wire-decoded
one). Route the ten remaining sites through to_unicode so both origins
work. Regression test covers equality, presence, substring,
approxMatch, greater/lessOrEqual and extensibleMatch.

Full suite green on py3.11 / 3.13 / 3.14.
@psi29a
psi29a merged commit 1a89484 into master Aug 25, 2026
5 checks passed
@psi29a
psi29a deleted the fixes/batch6 branch August 25, 2026 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parseFilter returns filters with attributeDesc of type str whereas request.filter has attributeDesc as BEROctetString

1 participant