Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag value (#text) must be a string when tag has additional parameters - unparse #366

Open
Behoston opened this issue Dec 9, 2024 · 1 comment

Comments

@Behoston
Copy link

Behoston commented Dec 9, 2024

Simple case - no params

data = {"a": 1}

works as expected, producing:

<a>1</a>

One param

However if tag a has parameter, its value must be a string, which is unexpected due to previous example.

data = {"a": {"@param": "test", "#text": 1}}

Throws an exception TypeError: decoding to str: need a bytes-like object, int found.

Param is integer, value is string

This works fine as well as simple case when only value of tag is provided:

data = {"a": {"@param": 1, "#text": "test"}}
<a param="1">test</a>
@Behoston Behoston changed the title Tag value (#text) must be a string when tag has additional parameters Tag value (#text) must be a string when tag has additional parameters - unparse Dec 9, 2024
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

No branches or pull requests

2 participants
@Behoston and others