Skip to content

[xmltodict] parse() returns None in streaming mode; force_list/force_cdata callback types are wrong #16827

Open

Description

@hemtilva

With xmltodict 1.0.4:

  • parse(..., item_depth=N) with N > 0 (streaming mode) returns None, but the stub always returns dict[str, Any], so parse(xml, item_depth=2, item_callback=cb)["a"] type-checks and fails at runtime.
  • force_list and force_cdata callables get the path as a list of (name, attrs) tuples, e.g. ([('a', None)], 'b', '1'), not a single tuple. force_list's value can also be a dict or None. So a correctly written callback is rejected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions