Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

add_field_layer Example Error #195

Closed mshihadeh closed 8 years ago

mshihadeh commented 8 years ago

I'm modeling some code off of the example add_field_layer, and I've been running into some issues. I decided to run the example file (minus actually adding the fields) to see if it was on my end or not. Turns out that it produces the same error that I was getting with my code (I saved the code as test.py):

updateUserProfileDisabled  - attribute not implemented in Portal class.
No JSON object could be decoded
Traceback (most recent call last):
  File "C:\Python27\ArcGISx6410.3\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
    exec codeObject in __main__.__dict__
  File "C:\Users\shihadehm\Desktop\test.py", line 29, in <module>
    initialize=True)
  File "C:\Python27\ArcGIS10.3\Lib\site-packages\arcrest\agol\layer.py", line 123, in __init__
    self.__init()
  File "C:\Python27\ArcGIS10.3\Lib\site-packages\arcrest\agol\layer.py", line 137, in __init
    for k,v in json_dict.iteritems():
AttributeError: 'str' object has no attribute 'iteritems'

The line of code throwing the exception (Line 29) is

fl = FeatureLayer(
            url=url,
            securityHandler=agolSH,
            proxy_port=proxy_port,
            proxy_url=proxy_url,
            initialize=True)

I tried using multiple feature layers with the same results, and my URLs are definitely correct. Any help is much appreciated.

pLeBlanc93 commented 8 years ago

@mshihadeh what version of ArcREST are you using?