Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: handle invalid tessdata folder #559

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

PatrickDaG
Copy link

The newest tesseract version returns an error and exits when encountering invalid tessdata-dir. This makes these tests fail. The only tests that would still work would be to set tessdata-dir to a new empty folder, but that would mean making and then deleting that folder, for what I think is negligible benefit.

@stefan6419846
Copy link
Contributor

Shouldn't we gracefully handle this in pytesseract instead and keep a variant of these tests? Just removing them does not feel right. The handling should probably depend on the Tesseract version as well.

@PatrickDaG
Copy link
Author

I must admit I'm not using pytesseract so I don't know if this library depends of gracefully handling /dev/null as a tessdata folder, otherwise I'm not seeing the benefits of keeping tests related to undocumented, and not stable behaviour of tesseract.

@bozhodimitrov
Copy link
Collaborator

bozhodimitrov commented Nov 22, 2024

I am not ok with removing invalid path testing.
Please reconsider contributing something that might handle the new behavior of the new tesseract version.
For sure it can be adapted. If there is a stable OS version that supports such recent tesseract version, we can add it to the CI and adjust to the new changed behavior.

@PatrickDaG
Copy link
Author

I've tried my best, to make it work and gracefully handle errors. I must admit it isn't perfect but its about as far as my limited pytest and pytesseracte knowledge gets me.

@PatrickDaG PatrickDaG changed the title fix: remove tests broken following tesseract 5.5.0 fix: handle invalid tessdata folder Nov 22, 2024
@bozhodimitrov
Copy link
Collaborator

Thank you for trying. Unfortunately it alters some of the current behavior and if Tesseract is not installed it will not say it.
I might adjust the patch later, since I work on another fix at the moment.

@bozhodimitrov bozhodimitrov force-pushed the master branch 19 times, most recently from e5d07eb to deff509 Compare November 22, 2024 17:30
@bozhodimitrov bozhodimitrov force-pushed the master branch 3 times, most recently from 7fc814d to 6e4f31c Compare November 22, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants