Skip to content

fix: do not reference package directory in PDFToTextOCRConverter.convert()#3478

Merged
ZanSara merged 3 commits intomainfrom
ocr-converter-temp-path
Oct 31, 2022
Merged

fix: do not reference package directory in PDFToTextOCRConverter.convert()#3478
ZanSara merged 3 commits intomainfrom
ocr-converter-temp-path

Conversation

@ZanSara
Copy link
Contributor

@ZanSara ZanSara commented Oct 26, 2022

Related Issues

Proposed Changes:

  • Remove path referencing the package folder from
    temp_img = tempfile.NamedTemporaryFile(dir=os.path.dirname(os.path.realpath(__file__)), suffix=".jpeg")
  • This path causes issues if the package folder is not writable (non editable installs with Conda on Windows, just to name an example)

How did you test it?

  • CI

Notes for the reviewer

n/a

Checklist

@ZanSara ZanSara requested a review from a team as a code owner October 26, 2022 08:41
@ZanSara ZanSara requested review from vblagoje and removed request for a team October 26, 2022 08:41
@ZanSara ZanSara changed the title fix: remove weird temp path from PDFToTextOCRConverter.convert() fix: do not reference package directory in PDFToTextOCRConverter.convert() Oct 26, 2022
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZanSara seems a bit confusing about what is going on here. It seems like some knowledge is lost between the lines. Perhaps a small comment to explain what is going on?

Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZanSara ZanSara merged commit adc982a into main Oct 31, 2022
@ZanSara ZanSara deleted the ocr-converter-temp-path branch October 31, 2022 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PDFToTextOCRConverter.convert() write temp files into the package folder

2 participants