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

_asdict on ExtractResult empty on Python 3+ #70

Closed
otakucode opened this issue May 23, 2015 · 2 comments
Closed

_asdict on ExtractResult empty on Python 3+ #70

otakucode opened this issue May 23, 2015 · 2 comments

Comments

@otakucode
Copy link
Contributor

When using tldextract on Python 3.4 I noticed that the dict attribute of the namedtuple ExtractResult would always be empty, which caused its _asdict method to also return an empty dict. This is because ExtractResult does not define a slots member, which prevents the parent classes dict from being added. I am not sure which version of Python changed this behavior. I added a unit test (and also added Py34 to the tox.ini environments) for this issue and it passed for Python 2.7, but failed for Python 3.4. Those are the only versions I had installed. I fixed the issue in tldextract.py and all tests now pass, both in 2.7 and 3.4. I created pull request #69 with the fix and additional test.

@john-kurkowski
Copy link
Owner

Merged #69. Thanks!

@john-kurkowski
Copy link
Owner

For posterity, this was a bug in Python, somewhere in the 3.4.x series. The PR's workaround is no longer necessary at least as of Python 3.5.2. See this SO discussion.

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

2 participants