[SOLVED] python: UnicodeEncodeError: 'ascii' codec can't encode character
by kaz2100 from LinuxQuestions.org on (#5G36H)
To whom it may concern:
System Debain amd64, python 2.7.18 (probably python3 also runs into same issue)
SituationCode:"""%s\n""" % ... is rewritten intoCode:"""{}\n""".format(...)then an errorCode:UnicodeEncodeError: 'ascii' codec can't encode character u'\...pops out.
TroubleShooting Several sites mention about environment variable, .decode() or default code setting, but not much help with me.
BingoCode:u"""{}\n""".format(...)Original script is coded by not me, so I have not investigated throughly.
Closing remark Thank you for your time. Any additional comments will be appreciated.


System Debain amd64, python 2.7.18 (probably python3 also runs into same issue)
SituationCode:"""%s\n""" % ... is rewritten intoCode:"""{}\n""".format(...)then an errorCode:UnicodeEncodeError: 'ascii' codec can't encode character u'\...pops out.
TroubleShooting Several sites mention about environment variable, .decode() or default code setting, but not much help with me.
BingoCode:u"""{}\n""".format(...)Original script is coded by not me, so I have not investigated throughly.
Closing remark Thank you for your time. Any additional comments will be appreciated.