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

Unparse indent not included in 0.13.0 release? #312

Open
AlbertoV5 opened this issue Oct 5, 2022 · 0 comments
Open

Unparse indent not included in 0.13.0 release? #312

AlbertoV5 opened this issue Oct 5, 2022 · 0 comments

Comments

@AlbertoV5
Copy link

Hello. Thanks a lot for this great module.

I'm using version 0.13.0 from PyPi and it doesn't include support for unparse indent with an integer, from this PR: #222

I'm not sure what the timeline in the release and the PR merge was but I'm guessing it will come in the next release then?

Just wanted to make sure. Thank you.

def test_unparse_indent():
    """
    pip freeze | grep xmltodict
    xmltodict==0.13.0
    """
    import xmltodict
    import logging
    log = logging.getLogger(__name__)
    d = xmltodict.parse(
    """<a>
        <b>
        <!-- b comment -->
        <c>
            <!-- c comment -->
            1
        </c>
        <d>2</d>
        </b>
    </a>
    """
    )
    log.debug(xmltodict.unparse(d, pretty=True, indent="  "))
    """
    <?xml version="1.0" encoding="utf-8"?>
    <a>
      <b>
        <c>1</c>
        <d>2</d>
      </b>
    </a>
    """
    log.debug(xmltodict.unparse(d, pretty=True, indent=2))
    """"TypeError: decoding to str: need a bytes-like object, int found"""
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

1 participant