Skip to content

fix: handle str message decode in ESX Request/Reply unicode method - #432

Open
DuckBoss wants to merge 1 commit into
mainfrom
jajerome/fix-suds-str-decode
Open

fix: handle str message decode in ESX Request/Reply unicode method#432
DuckBoss wants to merge 1 commit into
mainfrom
jajerome/fix-suds-str-decode

Conversation

@DuckBoss

@DuckBoss DuckBoss commented Aug 5, 2026

Copy link
Copy Markdown

Request.unicode() and Reply.unicode() unconditionally called .decode("raw_unicode_escape") on self.message, which fails with AttributeError on Python 3.14+ when message is a str rather than bytes. This broke 24 suds transport tests on Fedora latest (Python 3.14) where pytest's log capture eagerly formats the log arguments.

Guard .decode() with an isinstance(message, bytes) check so both str and bytes messages are handled correctly.

Assisted-by: Cursor

Request.__unicode__() and Reply.__unicode__() unconditionally called
.decode("raw_unicode_escape") on self.message, which fails with
AttributeError on Python 3.14+ when message is a str rather than bytes.
This broke 24 suds transport tests on Fedora latest (Python 3.14)
where pytest's log capture eagerly formats the log arguments.

Guard .decode() with an isinstance(message, bytes) check so both
str and bytes messages are handled correctly.

Assisted-by: Cursor
Signed-off-by: Jason Jerome <jajerome@redhat.com>
@DuckBoss

DuckBoss commented Aug 6, 2026

Copy link
Copy Markdown
Author

Fixes pytest failures that show up in this PR: #431

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.

1 participant