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

new locale assertions in Tesseract are incompatible with Click #23

Closed
bertsky opened this issue Sep 26, 2018 · 5 comments
Closed

new locale assertions in Tesseract are incompatible with Click #23

bertsky opened this issue Sep 26, 2018 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@bertsky
Copy link
Collaborator

bertsky commented Sep 26, 2018

Ever since Tesseract 4 had to introduce an assertion that localization be plain POSIX (C) to ensure certain legacy assumptions in its code are always met, we have to override the current locale before initializing tesserocr API, too. This cannot be done by the user before calling any ocrd_tesserocr CLI, because we depend on the Click library, which itself is incompatible (in Python 3) with that locale (it requires at least C.UTF-8). So we have a deadlock.

We could perhaps reset the locale after click and before tesserocr though.

@kba
Copy link
Member

kba commented Sep 27, 2018

So the tests work because they use the ocrd_tesserocr API directly, right? I ran into that encoding issue with different CI platforms, yes we need to override LC_* after loading click. We should add tests that use the CLI as well. I'll look into it.

@kba kba self-assigned this Sep 27, 2018
@kba kba added the bug Something isn't working label Sep 27, 2018
@kba
Copy link
Member

kba commented Sep 27, 2018

Oh you fixed it already. Self-fixing issues are the best issues 👍

@bertsky
Copy link
Collaborator Author

bertsky commented Sep 27, 2018

No, the tests (presumably) still work, because they use an older Tesseract version without the assertion in place. True, we should add a CLI test (as in core/test/test_cli.py)...

@kba kba closed this as completed in #24 Sep 27, 2018
@kba
Copy link
Member

kba commented Sep 27, 2018

No, the tests (presumably) still work, because they use an older Tesseract version without the assertion in place.

They did fail before but we set the locale to C before running the tests

https://github.com/OCR-D/ocrd_tesserocr/blob/master/.travis.yml#L32

@bertsky
Copy link
Collaborator Author

bertsky commented Sep 27, 2018

Oh, I see. I was distracted by my (non-container) test results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants