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
TypeError when namespaces contain the key "self" #216
Labels
S: triage
Issue needs triage.
Comments
Yup, this is a bug. I have a fix in #217. I'm not quite sure why I was using After the fix your example script runs fine: $soupsieve git:(master) ✗ python3 bug.py
[<identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>, <identifier scheme="http://www.sec.gov/CIK">0001031235</identifier>] |
facelessuser
added a commit
that referenced
this issue
Mar 19, 2021
Thanks for the bug report! I've tagged a new release 2.2.1. It should be available shortly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was using bs4/soupsieve to parse some xml files from SEC websites. Here is my MWE
It worked smoothly until I got a weird
TypeError
when I used the CSS selectorIt turned out this specific xml file contains namespaces with the key "self", which caused the
TypeError
when you unpacked the namespaces as keyword parameters in line 47 ofsoupsieve/__init__.py
Not sure if this counts as a bug of soupsieve, or should I handle this issue on my side. Feel free to suggest a solution for me.
The text was updated successfully, but these errors were encountered: