Esri / ArcREST

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

Cannot upload metadata to ArcGIS online #252

Closed thomas-maschler closed 8 years ago

thomas-maschler commented 8 years ago

When trying to upload metadata to ArcGIS online I get an error message:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Python27\ArcGIS10.4\lib\site-packages\arcrest\manageorg\_content.py", line 1016, in updateMetadata
    metadata=metadataFile)
  File "C:\Python27\ArcGIS10.4\lib\site-packages\arcrest\manageorg\_content.py", line 1677, in updateItem
    tempfile = os.path.join(tempfile.gettempdir(), "metadata.xml")
UnboundLocalError: local variable 'tempfile' referenced before assignment
achapkowski commented 8 years ago

@thomas-maschler I'll take a look

achapkowski commented 8 years ago

@thomas-maschler can you please post your code, I cannot reproduce your issue. Thank you.

thomas-maschler commented 8 years ago
import arcrest
from arcresthelper import securityhandlerhelper
config = {'username': 'tmaschler_gfw', 'password': 'secret'}
token = securityhandlerhelper.securityhandlerhelper(config)
admin = arcrest.manageorg.Administration(securityHandler=token.securityhandler)
item = admin.content.getItem(itemId="97f5c4376fa34769b5f057001b2e18cc")
item.updateMetadata("C:\Users\Thomas.Maschler\Documents\Atlas\GAB\gab_Serie_Agricole.shp.xml")
achapkowski commented 8 years ago

@thomas-maschler thank you for the code, let me see if I can reproduce now.

achapkowski commented 8 years ago

@thomas-maschler Issue should be resolved. Thank you for letting us know.