Skip to content

bug in pdf.py? #6

Description

@bertca

Hi,
I updated pdf_scrape to the latest version. Unfortunately i got error messages (see below). When I gave the error to Claude, he came up with the following:


What you can do:

Report it upstream. This is a bug in pdf_scrape's own code (pdf.py line 409) — file an issue on that component's GitHub repo with this traceback.
Patch it locally as a stopgap. In /config/custom_components/pdf_scrape/pdf.py, line 409, change:
python
(await self.hass.async_add_job_executor(self.file.stat)).st_mtime,

to:

python
(await self.hass.async_add_executor_job(self.file.stat)).st_mtime,

That's a straight rename to the real method — takes the same arguments (callable + args), so no other changes needed. It'll get overwritten on the component's next update, so re-apply after upgrading until upstream fixes it.


The error message was:


Logger: homeassistant.config_entries
Source: config_entries.py:803
First occurred: September 18, 2026 at 11:41:59 AM (2 occurrences)
Last logged: September 18, 2026 at 11:42:00 AM

Error setting up entry engiedynamisch.pdf for pdf_scrape
Error setting up entry /config/www/engiedirect.pdf for pdf_scrape
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 803, in __async_setup_with_context
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/pdf_scrape/init.py", line 261, in async_setup_entry
pdflocal: PDFScrapeFile = await PDFScrapeFile.pdfscrape(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...<3 lines>...
)
^
File "/config/custom_components/pdf_scrape/pdf.py", line 401, in pdfscrape
await self._pdf_scrape()
File "/config/custom_components/pdf_scrape/pdf.py", line 116, in _pdf_scrape
await self.update()
File "/config/custom_components/pdf_scrape/pdf.py", line 409, in update
(await self.hass.async_add_job_executor(self.file.stat)).st_mtime,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'HomeAssistant' object has no attribute 'async_add_job_executor'. Did you mean: 'async_add_import_executor_job'?


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions