Search code examples
python-2.7unicodecharacter-encodingpypiyolk

Yolk crashes when PyPi package descriptions contain certain characters


Yolk (0.8.7) reports and encoding error when printing information about packages. For example, when I

yolk -M crypto-enigma

I get

UnicodeEncodeError: 'ascii' codec can't encode character u'\u03b2' in position 2322: ordinal not in range(128)

because the PyPi page for the package has a β in it. Or if I try

yolk -M Metafone

I get

UnicodeEncodeError: 'ascii' codec can't encode characters in position 3291-3292: ordinal not in range(128)

Is there a way to avoid this error? It seems like a bug that Yolk would crash just because there's a Greek character or mathematical symbol in the PyPi page for a package.


Solution

  • This is a bug, which manifests only in Python 2.x, fixed in versions >= 0.8.8 (see fc842a3).