AnalogJ / lexicon

Manipulate DNS records on various DNS providers in a standardized way.
MIT License
1.48k stars 305 forks source link

unexpected keyword argument 'cache_file' #692

Open Darkproduct opened 3 years ago

Darkproduct commented 3 years ago

Using lexicon on Ubuntu 20.04 LTS Installed like this: sudo apt install lexicon with version 3.3.17-1.

With: lexicon provider list domain A

Traceback (most recent call last):
  File "/usr/bin/lexicon", line 11, in <module>
    load_entry_point('dns-lexicon==3.3.17', 'console_scripts', 'lexicon')()
  File "/usr/lib/python3/dist-packages/lexicon/cli.py", line 115, in main
    client = Client(config)
  File "/usr/lib/python3/dist-packages/lexicon/client.py", line 45, in __init__
    domain_extractor = tldextract.TLDExtract(cache_file=TLDEXTRACT_CACHE_FILE,
TypeError: __init__() got an unexpected keyword argument 'cache_file'

Not sure what is going on here. I don't use python and this is an almost fresh VM, so I don't think this is a dependency issue on my end.

henningw commented 3 years ago

I see this error as well on version 3.5.3, from test_clients and test_library tests in my debian buster build environment.

henningw commented 3 years ago

My problem is that the syntax for the tldextract dependency was changed from cache_file to cache_dir. If I change this back to cache_file, it works. Maybe you can also have a look to your tldextract version. The 2.x uses cache_file, the 3.x cache_dir.

adferrand commented 3 years ago

@Darkproduct

Indeed, tldextract 3.x uses the cache_dir directive. However on Ubuntu 20.04 LTS, only tldextract 2.x is available, so Lexicon in version 3.3.17 should still work. Have you install some packages with other tools than apt/apt-get?

adferrand commented 3 years ago

@henningw for you it is the contrary: Lexicon 3.5.3 migrated to use cache_dir along with tldextract 3.x, but only 2.x is present for buster. Since you are on the edge, I think I can provide a new version to make Lexicon compatible with both tldextract 2.x and 3.x to be compatible with buster OS packages.

henningw commented 3 years ago

@adferrand thanks for the reply, i already created the one liner patch, but a version that could support both versions would be great. I also adapted my build to not depend on poetry by converting it to setuptools, as this is also not available on buster.

GrumpyMetalGuy commented 3 years ago

Hi, am struggling with this also on my RPi 3b. @henningw what was the patch you applied? @adferrand , is it possible to release a version with a fix that will work for both? Happy to test out anything if it helps!

adferrand commented 3 years ago

What is the version of Lexicon you are using ? Normally I fixed that with version 3.5.4.

GrumpyMetalGuy commented 3 years ago

Ah, was 3.3.28 - apologies for the noise!