ocropus / hocr-tools

Tools for manipulating and evaluating the hOCR format for representing multi-lingual OCR results by embedding them into HTML.
Other
359 stars 78 forks source link

DeprecationWarning about decodestring #145

Closed zuphilip closed 5 years ago

zuphilip commented 5 years ago

With Python 3 I see now for hocr-pdf the following warning:

hocr-pdf:145: DeprecationWarning: decodestring() is a deprecated alias since
Python 3.1, use decodebytes()
  uncompressed = bytearray(zlib.decompress(base64.decodestring(font)))

Can we fix that easily such that also Python 2 is still supported?

stweil commented 5 years ago

@zuphilip, is support for Python 2 still needed? Or can we drop it in the near future?

zuphilip commented 5 years ago

Ocropus itself is currently Python 2 only. There is a PR to make it Python 2+3 compatible, but that still needs some time to test and review. I am skeptical that we should switch to Python 3 only.

stweil commented 5 years ago

OCR-D requires Python 3 for its Python scripts.

zuphilip commented 5 years ago

I know.

But there were already quite some discussion about that in the ocropus repository, and supporting Python 2 seems still important in these contexts.