Article ID: 128788, created on May 3, 2016, last review on May 3, 2016

  • Applies to:
  • Operations Automation 6.0

Symptoms

readCSPAccounts.py script throws the following error:

Error: 'ascii' codec can't encode character u'\u2013' in position 7: ordinal not in range(128)

Cause

Python-specific error in case script input string (CSP account information like subdomain or login) can not be converted according to the encoding rules. Please, refer to the Python UNICODE howto article to obtain more detailed information.

Resolution

Insert the following code block to the script readCSPAccounts.py

import sys
...
reload(sys)
sys.setdefaultencoding('utf-8')

Then re-run the script.

Search Words

readCSPAccounts.py error

ordinal not in range(128)

readCSPAccounts.py script error

ReadCSPAccounts.py generates weird uuencode error

Error: 'ascii' codec can't encode character u'\u2013' in position 7: ordinal not in range(128)

5356b422f65bdad1c3e9edca5d74a1ae caea8340e2d186a540518d08602aa065 e12cea1d47a3125d335d68e6d4e15e07 956c448bddc7e1f3585373687602379f 6f1456866eed87488c0f02b298a741c0

Email subscription for changes to this article
Save as PDF