ubergeek42 / lambda-letsencrypt

Free Lets-Encrypt certificate management for CloudFront/AWS
MIT License
211 stars 37 forks source link

Use UTF8 #17

Closed fregante closed 8 years ago

fregante commented 8 years ago

u'\u2713' crashes on:

OS X 10.11.5
Python 2.7.11

Log:

> Are these settings correct[Y/n]? y

Making Requested Changes
Creating SNS Topic for Notifications Traceback (most recent call last):
  File "wizard.py", line 549, in <module>
    wizard(global_config)
  File "wizard.py", line 543, in wizard
    wizard_save_config(global_config)
  File "wizard.py", line 393, in wizard_save_config
    print(colors.OKGREEN + u'\u2713' + colors.ENDC)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2713' in position 5: ordinal not in range(128)

I should add that while this PR fixes it on Python 2.7, with Python 3.5.1 is still broken.

Note: I'm not a Python developer

fregante commented 8 years ago

As a follow-up:

$ python --version
Python 3.5.1
$ python -c 'import sys; print(sys.getdefaultencoding())'
utf-8
$ export PYTHONIOENCODING=utf-8
$ ./wizard.py
...it works