Example Python script not working from ESRI site

1732
4
02-19-2016 04:30 AM
RobertBuckley1
Occasional Contributor

Example: Check a folder for stopped services—Documentation (10.3 and 10.3.1) | ArcGIS for Server

I wanted to test this Script, but I always get the following error after running:

Processed folder information successfully. Now processing services...

Traceback (most recent call last):

  File "C:\Users\gisadmin\Desktop\AGSAdmin_py\CheckStopped.py", line 164, in <module>

    sys.exit(main(sys.argv[1:]))

  File "C:\Users\gisadmin\Desktop\AGSAdmin_py\CheckStopped.py", line 83, in main

    httpConn.request("POST", statusURL, params, headers)

  File "D:\Python27\ArcGISx6410.3\lib\httplib.py", line 995, in request

    self._send_request(method, url, body, headers)

  File "D:\Python27\ArcGISx6410.3\lib\httplib.py", line 1029, in _send_request

    self.endheaders(body)

  File "D:\Python27\ArcGISx6410.3\lib\httplib.py", line 991, in endheaders

    self._send_output(message_body)

  File "D:\Python27\ArcGISx6410.3\lib\httplib.py", line 844, in _send_output

    self.send(msg)

  File "D:\Python27\ArcGISx6410.3\lib\httplib.py", line 820, in send

    self.sock.sendall(data)

  File "D:\Python27\ArcGISx6410.3\lib\socket.py", line 224, in meth

    return getattr(self._sock,name)(*args)

UnicodeEncodeError: 'ascii' codec can't encode character u'\xdf' in position 71: ordinal not in range(128)

>>>

Other scripts have worked fine from the examples list - why doesn´t this one work?

Cheers,

Rob

0 Kudos
4 Replies
RichardMiedema1
Esri Contributor

Hello Rob,

This can happen when your map services contain some "strange" characters. If you keep the names simple, this will not happen.

Richard

0 Kudos
RobertBuckley1
Occasional Contributor

I have checked the names of my services. The names consist of either english letters, numbers or an underscore. No "strange" characters exist

0 Kudos
RobertBuckley1
Occasional Contributor

Ah...could be that it doesn´t work with Image Services.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Check again

>>> print(u'\xdf' )

ß

>>>

0 Kudos