architv / soccer-cli

:soccer: Football scores for hackers. :computer: A command line interface for all the football scores.
MIT License
1.09k stars 220 forks source link

Fix team output crash #61

Closed Saturn closed 8 years ago

Saturn commented 8 years ago

Fixed a crash when a player had a market value of null.

$ python -m soccer.main --team AFC --players
...
...
AttributeError: 'NoneType' object has no attribute 'encode'

Removed all of the other str encoding stuff as it works just the same without it? I have tested on Windows too. Although Windows cmd cannot display the € symbol. But I don't know what can be done about that. Using this terminal https://mintty.github.io I was able to display the character just fine.

When using the string mod operator I do not think there is any need to do str(some_number).

Also cleaned up the formatting around the mod format strings. It was really difficult to work with when they are all squashed up.

architv commented 8 years ago

@Saturn I don't have windows on my machine so can't really test. Does your linux terminal display € symbol? Mine doesn't. selection_066

Yes, we don't need to do str(some_number) when using the string mod operator. Thanks for the fix!

Saturn commented 8 years ago

@architv Yes. My terminal does display the Euro symbol. But my windows terminal displays the question mark just like your screenshot.

Could it be a font issue? Really frustrating problem.