Skip to content

fix: XML pretty-printing crash for non-ASCII in httpops#123

Merged
barny merged 1 commit intoIBM:masterfrom
TiagoMLucio:master
Mar 2, 2026
Merged

fix: XML pretty-printing crash for non-ASCII in httpops#123
barny merged 1 commit intoIBM:masterfrom
TiagoMLucio:master

Conversation

@TiagoMLucio
Copy link
Copy Markdown
Contributor

This pull request solves #121 by improving the robustness of XML handling in the logging functions of elmclient/httpops.py. The changes ensure that XML parsing errors do not interrupt logging by introducing exception handling and proper encoding management.

Improvements to XML logging robustness:

  • Added try/except blocks around XML parsing and formatting in both _log_request and _log_response to prevent failures when encountering malformed XML or encoding issues. [1] [2]
  • Updated XML serialization to use encoding='unicode', ensuring consistent output and handling of string/byte inputs. [1] [2]

Signed-off-by: FIXED-TERM Mariotto Lucio Tiago (ME-EC/ENG2) <fixed-term.Tiago.MariottoLucio@de.bosch.com>
@barny barny merged commit e076757 into IBM:master Mar 2, 2026
1 check passed
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.

2 participants