mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Working arround current TIKA Library Bugs - lint
This commit is contained in:
parent
d875be60d4
commit
56fcb3fee1
@ -1,9 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import array
|
|
||||||
|
|
||||||
import dateutil.parser
|
|
||||||
import httpx
|
import httpx
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
@ -56,7 +53,7 @@ class TikaDocumentParser(DocumentParser):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
with TikaClient(tika_url=settings.TIKA_ENDPOINT) as client:
|
with TikaClient(tika_url=settings.TIKA_ENDPOINT) as client:
|
||||||
with open(document_path, 'rb') as f:
|
with open(document_path, "rb") as f:
|
||||||
content = f.read()
|
content = f.read()
|
||||||
parsed = client.tika.as_text.from_buffer(content, mime_type)
|
parsed = client.tika.as_text.from_buffer(content, mime_type)
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user