Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

get_fld #24

Open
microchip8 opened this issue Nov 6, 2019 · 12 comments
Open

get_fld #24

microchip8 opened this issue Nov 6, 2019 · 12 comments

Comments

@microchip8
Copy link

Hi,

there's a typo (I think) in your script. Instead of get_tld, you use get_fld. This does not work here (fails to import error). When I change get_fld to get_tld in your script, the script works

@LINKIWI
Copy link
Owner

LINKIWI commented Nov 6, 2019

Thanks for reporting, I'm happy to accept a PR to fix. cc @FFY00 who contributed the original patch and might have more context.

@FFY00
Copy link
Contributor

FFY00 commented Nov 6, 2019

It was definitely working, it probably was an API change. I will have a look when I get home.

@1deadpixl
Copy link
Contributor

Ran into this same problem after installing on my RPi. Tried the edit that @microchip8 suggested, but that didn't work (still couldn't find module tld). Turns out the script was running in Python 2.7 instead of Python 3 were the modules were installed because. Changed the first line of the script to use python3 and it works perfectly.

@FFY00
Copy link
Contributor

FFY00 commented Nov 8, 2019

Sorry for the late response. get_fld is totally correct, IIRC I was using https://github.com/barseghyanartur/tld so make sure that is installed.

@microchip8
Copy link
Author

I use my distro's python 3 packages. I have the following

python3-tld-0.7.10
python3-tldextract-2.2.0

it does not work with these versions. Only when I changed get_fld to get_tld twice in the script (import at top and below where it is called) did the script work.

@FFY00
Copy link
Contributor

FFY00 commented Nov 8, 2019

Your tld version seems to be a bit old. Your purposed fix just gets rid of the import error, but it will not work if you try to use subdomains.

@1deadpixl what do you want to do? Support older versions of tld, use a try block here so that users will only run into this issue when they use subdomains, etc?

@FFY00
Copy link
Contributor

FFY00 commented Nov 8, 2019

@microchip8 you can get rid of the issue by installing tld with pip.

@microchip8
Copy link
Author

OK, thanks :)

@LINKIWI
Copy link
Owner

LINKIWI commented Nov 8, 2019

Would probably be a good idea to lock the version of all dependencies in requirements.txt, if anyone has time to submit a PR I'd be happy to merge

@1deadpixl
Copy link
Contributor

@FFY00 I think it was a config error on my part: pip on my Pi is managing Python 3 packages, but the python command is running Python 2.7. I think your script is good to go if it's backwards-compatible with Python 2.7 (and assuming users have their machines configured correctly 😛)

@james090500
Copy link

For future visitors. The current work around I have to use when ever installing this software is this

sudo pip2 uninstall backports.functools-lru-cache -y
sudo apt install python-backports.functools-lru-cache -y

@tiemonl
Copy link

tiemonl commented May 27, 2020

For future visitors. The current work around I have to use when ever installing this software is this

sudo pip2 uninstall backports.functools-lru-cache -y
sudo apt install python-backports.functools-lru-cache -y

That fixed the issue for me. Thank you for this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants