You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This used to work (1.7.x), now (2.11.1) it asserts:
def remove_namespaces(self) -> None:
"""
Remove all namespaces, allowing to traverse the document using
namespace-less xpaths. See :ref:`removing-namespaces`.
"""
for el in self.root.iter("*"):
AttributeError: 'dict' object has no attribute 'iter'
I appreciate JSON doesn't have namespaces, but it should fail gracefully, not raise an assertion.
The text was updated successfully, but these errors were encountered:
But AttributeError: 'dict' object has no attribute 'iter' is a meaningless error for a scrapy user.
If there's an exception (fine), it should be something meaningful "Cannot remove namespaces from JSON" or something - that's why I consider it a Scrapy issue.
Regression.
As part of my unit tests, I have a well-formed JSON file that I'm using in some tests as "bad" data (the script wants XML).
I do something like this:
This used to work (1.7.x), now (2.11.1) it asserts:
I appreciate JSON doesn't have namespaces, but it should fail gracefully, not raise an assertion.
The text was updated successfully, but these errors were encountered: