anntzer / redeal

A reimplementation of Thomas Andrews' Deal in Python.
Other
63 stars 41 forks source link

UnicodeEncodeError #1

Closed LilyFoote closed 12 years ago

LilyFoote commented 12 years ago

Trying to get the example in README.txt to run under python 2.7, I get this traceback:

./redeal.py -n 10
Traceback (most recent call last):
  File "./redeal.py", line 360, in <module>
    tries = generate(n_hands, max_tries, predeal, accept)
  File "./redeal.py", line 305, in generate
    if accept(found, deal):
  File "./redeal.py", line 351, in <lambda>
    lambda found, deal: print(str(deal)) or True)
  File "./redeal.py", line 120, in __str__
    return " ".join(map(str, self.hands))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2660' in position 0: ordinal not in range(128)

Running under python 3.2 works correctly.