Instead of ascii this should be `sys.getdefaultsystemencoding()`, which by default is utf8 on Python 3.