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

Tox fails for Python 3.11 #484

Closed
Sammeeey opened this issue Apr 12, 2023 · 1 comment · Fixed by #506
Closed

Tox fails for Python 3.11 #484

Sammeeey opened this issue Apr 12, 2023 · 1 comment · Fixed by #506

Comments

@Sammeeey
Copy link

After installing pytesseract from source & running tox, I get the following response:

Exception in thread Thread-3 (_readerthread):
Traceback (most recent call last):
  File "C:\Users\Name\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "C:\Users\Name\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Name\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1552, in _readerthread
    buffer.append(fh.read())
                  ^^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 38: invalid start byte
Exception in thread Thread-5 (_readerthread):
Traceback (most recent call last):
  File "C:\Users\Name\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "C:\Users\Name\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Name\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1552, in _readerthread
    buffer.append(fh.read())
                  ^^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfc in position 38: invalid start byte
py37: skipped because could not find python interpreter with spec(s): py37
py37: SKIP ⚠ in 0.38 seconds
py38: skipped because could not find python interpreter with spec(s): py38
py38: SKIP ⚠ in 0.02 seconds
py39: skipped because could not find python interpreter with spec(s): py39
py39: SKIP ⚠ in 0.03 seconds
py310: skipped because could not find python interpreter with spec(s): py310
  py37: SKIP (0.38 seconds)
  py38: SKIP (0.02 seconds)
  py39: SKIP (0.03 seconds)
  py310: SKIP (0.05 seconds)
  evaluation failed :( (0.61 seconds)

Since the documentation doesn't determine which Python versions are supported, ChatGPT told me to try contacting the package maintainers to ask about compatibility with Python 3.11..😄

I guess the tox tests are simply outdated, right?

@stefan6419846
Copy link
Contributor

This rather looks like an issue with Windows, as the tests run fine with Python 3.11.2 on Ubuntu 20.04:

2023-04-12T09:41:41.5895252Z py311: install_deps> python -I -m pip install -r /home/runner/work/pytesseract/pytesseract/requirements-dev.txt
2023-04-12T09:41:45.3103022Z .pkg: install_requires> python -I -m pip install 'setuptools>=40.0.4' 'wheel>=0.29.0'
2023-04-12T09:41:46.6842123Z .pkg: _optional_hooks> python /opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
2023-04-12T09:41:46.9688136Z .pkg: get_requires_for_build_sdist> python /opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
2023-04-12T09:41:47.0368300Z .pkg: freeze> python -m pip freeze --all
2023-04-12T09:41:47.3882740Z .pkg: pip==23.0.1,setuptools==67.4.0,wheel==0.38.4
2023-04-12T09:41:47.3886823Z .pkg: prepare_metadata_for_build_wheel> python /opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
2023-04-12T09:41:47.5613476Z .pkg: build_sdist> python /opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
2023-04-12T09:41:47.5987548Z py311: install_package_deps> python -I -m pip install 'Pillow>=8.0.0' 'packaging>=21.3'
2023-04-12T09:41:49.0169601Z py311: install_package> python -I -m pip install --force-reinstall --no-deps /home/runner/work/pytesseract/pytesseract/.tox/.tmp/package/1/pytesseract-0.3.10.tar.gz
2023-04-12T09:41:51.8611623Z py311: freeze> python -m pip freeze --all
2023-04-12T09:41:52.2341681Z py311: cfgv==3.3.1,distlib==0.3.6,filelock==3.11.0,identify==2.5.22,iniconfig==2.0.0,nodeenv==1.7.0,packaging==23.0,Pillow==9.5.0,pip==23.0.1,platformdirs==3.2.0,pluggy==1.0.0,pre-commit==3.2.2,pytesseract @ file:https:///home/runner/work/pytesseract/pytesseract/.tox/.tmp/package/1/pytesseract-0.3.10.tar.gz,pytest==7.3.0,PyYAML==6.0,setuptools==67.4.0,virtualenv==20.21.0,wheel==0.38.4
2023-04-12T09:41:52.2344757Z py311: commands[0]> python -bb -m pytest
2023-04-12T09:41:52.6875730Z ============================= test session starts ==============================
2023-04-12T09:41:52.6876556Z platform linux -- Python 3.11.2, pytest-7.3.0, pluggy-1.0.0 -- /home/runner/work/pytesseract/pytesseract/.tox/py311/bin/python
2023-04-12T09:41:52.6877376Z cachedir: .tox/py311/.pytest_cache
2023-04-12T09:41:52.6877725Z rootdir: /home/runner/work/pytesseract/pytesseract
2023-04-12T09:41:52.6877991Z configfile: tox.ini
2023-04-12T09:41:52.8918395Z collecting ... collected 48 items
2023-04-12T09:41:52.8918895Z 
2023-04-12T09:41:53.6798957Z tests/pytesseract_test.py::test_image_to_string_with_image_type[jpg] PASSED [  2%]
2023-04-12T09:41:54.6098635Z tests/pytesseract_test.py::test_image_to_string_with_image_type[jpeg2000] PASSED [  4%]
2023-04-12T09:41:55.4465745Z tests/pytesseract_test.py::test_image_to_string_with_image_type[pgm] PASSED [  6%]
2023-04-12T09:41:56.3371125Z tests/pytesseract_test.py::test_image_to_string_with_image_type[png] PASSED [  8%]
2023-04-12T09:41:57.2047071Z tests/pytesseract_test.py::test_image_to_string_with_image_type[ppm] PASSED [ 10%]
2023-04-12T09:41:58.0069221Z tests/pytesseract_test.py::test_image_to_string_with_image_type[tiff] PASSED [ 12%]
2023-04-12T09:41:58.8391162Z tests/pytesseract_test.py::test_image_to_string_with_image_type[gif] PASSED [ 14%]
2023-04-12T09:41:59.6171692Z tests/pytesseract_test.py::test_image_to_string_with_image_type[webp] PASSED [ 16%]
2023-04-12T09:42:00.4511336Z tests/pytesseract_test.py::test_image_to_string_with_args_type[path_str] PASSED [ 18%]
2023-04-12T09:42:01.1862903Z tests/pytesseract_test.py::test_image_to_string_with_args_type[image_object] PASSED [ 20%]
2023-04-12T09:42:01.1863910Z tests/pytesseract_test.py::test_image_to_string_with_numpy_array SKIPPED [ 22%]
2023-04-12T09:42:02.5110363Z tests/pytesseract_test.py::test_image_to_string_european PASSED          [ 25%]
2023-04-12T09:42:04.4069687Z tests/pytesseract_test.py::test_image_to_string_batch PASSED             [ 27%]
2023-04-12T09:42:07.7602136Z tests/pytesseract_test.py::test_image_to_string_multiprocessing PASSED   [ 29%]
2023-04-12T09:42:07.7643766Z tests/pytesseract_test.py::test_image_to_string_timeout PASSED           [ 31%]
2023-04-12T09:42:07.9127822Z tests/pytesseract_test.py::test_la_image_to_string PASSED                [ 33%]
2023-04-12T09:42:08.7113263Z tests/pytesseract_test.py::test_image_to_boxes PASSED                    [ 35%]
2023-04-12T09:42:09.2607117Z tests/pytesseract_test.py::test_image_to_osd PASSED                      [ 37%]
2023-04-12T09:42:10.0597739Z tests/pytesseract_test.py::test_image_to_pdf_or_hocr[pdf] PASSED         [ 39%]
2023-04-12T09:42:10.9267486Z tests/pytesseract_test.py::test_image_to_pdf_or_hocr[hocr] PASSED        [ 41%]
2023-04-12T09:42:11.7610385Z tests/pytesseract_test.py::test_image_to_alto_xml PASSED                 [ 43%]
2023-04-12T09:42:11.7617608Z tests/pytesseract_test.py::test_image_to_alto_xml_support SKIPPED (r...) [ 45%]
2023-04-12T09:42:11.7626874Z tests/pytesseract_test.py::test_image_to_data__pandas_support SKIPPED    [ 47%]
2023-04-12T09:42:11.7633013Z tests/pytesseract_test.py::test_image_to_data__pandas_output SKIPPED     [ 50%]
2023-04-12T09:42:11.8832208Z tests/pytesseract_test.py::test_image_to_data_common_output[bytes] PASSED [ 52%]
2023-04-12T09:42:11.9966318Z tests/pytesseract_test.py::test_image_to_data_common_output[dict] PASSED [ 54%]
2023-04-12T09:42:12.1147858Z tests/pytesseract_test.py::test_image_to_data_common_output[string] PASSED [ 56%]
2023-04-12T09:42:12.1148421Z tests/pytesseract_test.py::test_wrong_prepare_type[int] PASSED           [ 58%]
2023-04-12T09:42:12.1154904Z tests/pytesseract_test.py::test_wrong_prepare_type[float] PASSED         [ 60%]
2023-04-12T09:42:12.1166104Z tests/pytesseract_test.py::test_wrong_prepare_type[none] PASSED          [ 62%]
2023-04-12T09:42:12.1202089Z tests/pytesseract_test.py::test_wrong_tesseract_cmd[executable_name] PASSED [ 64%]
2023-04-12T09:42:12.1227636Z tests/pytesseract_test.py::test_wrong_tesseract_cmd[absolute_path] PASSED [ 66%]
2023-04-12T09:42:12.1280334Z tests/pytesseract_test.py::test_main_not_found_cases PASSED              [ 68%]
2023-04-12T09:42:12.1299485Z tests/pytesseract_test.py::test_proper_oserror_exception_handling[permission_error_path] PASSED [ 70%]
2023-04-12T09:42:12.1321366Z tests/pytesseract_test.py::test_proper_oserror_exception_handling[invalid_path] PASSED [ 72%]
2023-04-12T09:42:12.2271803Z tests/pytesseract_test.py::test_get_languages[default_empty_config] PASSED [ 75%]
2023-04-12T09:42:12.4729707Z tests/pytesseract_test.py::test_get_languages[custom_tessdata_dir] PASSED [ 77%]
2023-04-12T09:42:12.4811053Z tests/pytesseract_test.py::test_get_languages[incorrect_tessdata_dir] PASSED [ 79%]
2023-04-12T09:42:12.4890003Z tests/pytesseract_test.py::test_get_languages[invalid_tessdata_dir] PASSED [ 81%]
2023-04-12T09:42:12.5864846Z tests/pytesseract_test.py::test_get_languages[invalid_config] PASSED     [ 83%]
2023-04-12T09:42:12.5875874Z tests/pytesseract_test.py::test_file_to_dict[input_args0-expected0] PASSED [ 85%]
2023-04-12T09:42:12.5887492Z tests/pytesseract_test.py::test_file_to_dict[input_args1-expected1] PASSED [ 87%]
2023-04-12T09:42:12.5898694Z tests/pytesseract_test.py::test_file_to_dict[input_args2-expected2] PASSED [ 89%]
2023-04-12T09:42:12.5923213Z tests/pytesseract_test.py::test_get_tesseract_version[3.5.0-3.5.0] PASSED [ 91%]
2023-04-12T09:42:12.5941267Z tests/pytesseract_test.py::test_get_tesseract_version[4.1-a8s6f8d3f-4.1] PASSED [ 93%]
2023-04-12T09:42:12.5958711Z tests/pytesseract_test.py::test_get_tesseract_version[v4.0.0-beta1.9-4.0.0] PASSED [ 95%]
2023-04-12T09:42:12.5974441Z tests/pytesseract_test.py::test_get_tesseract_version_invalid[-Invalid tesseract version: ""] PASSED [ 97%]
2023-04-12T09:42:12.6003130Z tests/pytesseract_test.py::test_get_tesseract_version_invalid[invalid-Invalid tesseract version: "invalid"] PASSED [100%]
2023-04-12T09:42:12.6003458Z 
2023-04-12T09:42:12.6003760Z ======================== 44 passed, 4 skipped in 19.91s ========================
2023-04-12T09:42:12.6467443Z .pkg: _exit> python /opt/hostedtoolcache/Python/3.11.2/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
2023-04-12T09:42:12.6864687Z   py311: OK (31.33=setup[10.93]+cmd[20.41] seconds)
2023-04-12T09:42:12.6864984Z   congratulations :) (31.51 seconds)

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 a pull request may close this issue.

2 participants