openpreserve / fido

Format Identification for Digital Objects (FIDO) is a Python command-line tool to identify the file formats of digital objects. It is designed for simple integration into automated work-flows.
http://openpreservation.org/technology/products/fido/
Other
145 stars 47 forks source link

Add Unicode support in Windows and Python 2.7 #200

Closed sevein closed 3 years ago

sevein commented 3 years ago

This pull request enables Unicode support when running Python 2.7 from the Windows console. It relies on the win-unicode-console package which monkeypatches the standard library when platform.system() == 'Windows' and six.PY2. It can be reverted once fido abandons Python 2.7 (EOL reached) since 3.6+ is perfectly capable.

Fixes https://github.com/openpreserve/fido/issues/100.

image

sevein commented 3 years ago

@mistydemeo, thanks for looking at this. That marker is also new to me! This seems to be the full list: https://www.python.org/dev/peps/pep-0508/#environment-markers. I wasn't sure about win-unicode-console, but it seems widely used in github.com/search, e.g. https://github.com/jonathanj/eliottree, which installs the dependency using the same marker.