Skip to content

Conversation

@mauritsvanrees
Copy link
Member

Then the result with lxml 6 is the same as it was with lxml 5, instead of throwing an AttributeError. Alternatively, we could return None.

See diazo PR 92 and especially this comment and the one after it.

If we change repoze.xmliter in this way, it helps for Plone. But I am not sure if that is the best for repoze.xmliter itself.

Options I see:

  • Go for the current PR. Easiest for Plone.
  • Instead of explicitly raising the XMLSyntaxError like in this PR, return None instead. Needs a bit more changes in Plone, but they are not hard, and this may be a bit friendlier.
  • Plone copies the relevant repoze.xmliter code, probably into the diazo package, and adapts it to its needs. This is the most work, and needs a bit of discussion in Plone, but it may be the safest for other users of repoze.xmliter. Then my PR Switch to native namespace #22 would not be relevant to Plone anymore either, so I don't have to wait for that.
  • I suppose another option would be to change Plone so it does not call repoze.xmliter with an "empty" iterator. That is fine to check if the iterator is a list. But we pass other iterables as well, which may also function as generators, and then it won't work. So I don't want to go that route.

I like the first or second option best.

…rable.

Then the result with ``lxml`` 6 is the same as it was with ``lxml`` 5, instead of throwing an ``AttributeError``.
Alternatively, we could return None.

See [diazo PR 92](plone/diazo#92) and especially [this comment](plone/diazo#92 (comment)) and the one after it.

If we change `repoze.xmliter` in this way, it helps for Plone.  But I am not sure if that is the best for `repoze.xmliter` itself.
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