I use a task on a remote server to regularly backup our ArcGIS Server site (stand alone). I use PsExec (newest version) to remotely execute it. Since a short time it stopped working with the following error:
Traceback (most recent call last):
File "C:\Program Files\ArcGIS\Server\tools\admin\Backup.py", line 202, in <module>
sys.exit(backup())
File "C:\Program Files\ArcGIS\Server\tools\admin\Backup.py", line 75, in backup
token = getToken(serverName, serverPort, protocol, tokenURL, username, password)
File "C:\Program Files\ArcGIS\Server\tools\admin\Backup.py", line 166, in getToken
params = urllib.urlencode({'username': username.decode(sys.stdin.encoding).encode('utf-8'), 'password': password.decode(sys.stdin.encoding).encode('utf-8'),'client': 'referer','referer':'backuputility','f': 'json'})
TypeError: decode() argument 1 must be string, not None
So Python does not get the encoding string sys.stdin.encoding anymore.
When I start the script on the ArcGIS machine, it runs fine.
I am not sure when this stopped working, there haven't been changes on the server except Windows updates and updates of mapservices.