Comment 5 for bug 2005955

Revision history for this message
Jhonny Oliveira (jhonny-oliveira) wrote :

Hi!
I have made a couple of tweaks:
- downloaded the dictionaries into the package
- patched hypenization.py not to cleanup every time and allow this to work in advance:
  setup.py hyphenation --hyphenation-url="file://$(CURDIR)/debian/dictionaries/master.tar.gz"
- appended the following steps after build
  setup.py iso639
  setup.py iso3166
  setup.py translations
  setup.py gui
  setup.py resources

I'm able to build Calibre, but this test fails with the following error:

setup.py test --test-name=dom_load

test_dom_load (calibre.scraper.simple.find_tests.<locals>.TestSimpleWebEngineScraper) ... ERRORTraceback (most recent call last):
  File "/<<PKGBUILDDIR>>/setup/run-calibre-worker.py", line 14, in <module>
    sys.exit(main())
  File "/<<PKGBUILDDIR>>/src/calibre/utils/ipc/worker.py", line 196, in main
    exec(sys.argv[-1])
  File "<string>", line 1, in <module>
  File "/<<PKGBUILDDIR>>/src/calibre/scraper/simple.py", line 28, in worker_main
    s = SimpleScraper(source)
  File "/<<PKGBUILDDIR>>/src/calibre/scraper/simple_backend.py", line 56, in __init__
    profile = create_profile(source)
  File "/<<PKGBUILDDIR>>/src/calibre/scraper/simple_backend.py", line 34, in create_profile
    ans.setHttpUserAgent(random_common_chrome_user_agent())
  File "/<<PKGBUILDDIR>>/src/calibre/utils/random_ua.py", line 44, in random_common_chrome_user_agent
    return choose_randomly_by_popularity(tuple(common_chrome_user_agents()))
  File "/<<PKGBUILDDIR>>/src/calibre/utils/random_ua.py", line 30, in common_chrome_user_agents
    for x in user_agent_data()['common_user_agents']:
  File "/<<PKGBUILDDIR>>/src/calibre/utils/random_ua.py", line 14, in user_agent_data
    P('user-agent-data.json', data=True, allow_user_override=False))
  File "/<<PKGBUILDDIR>>/src/calibre/utils/resources.py", line 89, in get_path
    with open(fpath, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/<<PKGBUILDDIR>>/resources/user-agent-data.json'
 [0.5 s]

Any idea how to overcome this? Did I miss something?

Thank you!