lexicon icon indicating copy to clipboard operation
lexicon copied to clipboard

unexpected keyword argument 'cache_file'

Open Darkproduct opened this issue 4 years ago • 8 comments

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.

Darkproduct avatar Jan 12 '21 16:01 Darkproduct

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 avatar Jan 14 '21 07:01 henningw

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.

henningw avatar Jan 14 '21 12:01 henningw

@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 avatar Jan 14 '21 15:01 adferrand

@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.

adferrand avatar Jan 14 '21 15:01 adferrand

@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.

henningw avatar Jan 14 '21 19:01 henningw

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!

GrumpyMetalGuy avatar Apr 07 '21 21:04 GrumpyMetalGuy

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

adferrand avatar Apr 08 '21 19:04 adferrand

Ah, was 3.3.28 - apologies for the noise!

GrumpyMetalGuy avatar Apr 12 '21 08:04 GrumpyMetalGuy