I'm using the clone_items() function, which works fine for most operations.
For items that have attachments the clone_items() function (I'm assuming) runs the download attachment function from the AttachmentManager as a part of the cloning process.
The download attachment fails if the name of the attachment is a path referering to a local image, for the person that uploaded the image. For the most part the attachments are names "Fotos1.jpg", "Fotos2.jpg" and so on.
If the photo name is called "C:\\Users\\xyz\\Desktop\\xyz\\xyz.JPG' i get the error:
FileNotFoundError: [Errno 2] No such file or directory: "C:\\Users\\xyz\\Desktop\\xyz\\xyz.JPG'
Attachment info:
source_items.layers[0].attachments.get_list(oid=145)
[{'id': 61,
'globalId': 'eea8bc6b-5d97-4410-b10e-a8bc96c22788',
'parentGlobalId': '73e0b288-2a5d-4e75-bf75-1b672eff790a',
'name': "C:\\Users\\xyz\\Desktop\\xyz\\xyz.JPG',
'contentType': 'image/jpeg',
'size': 6387442,
'keywords': '',
'exifInfo': None}]
source_items.layers[0].attachments.download(oid=145, save_path=r"C:\LOCAL\PATH")
FileNotFoundError: [Errno 2] No such file or directory: "C:\\Users\\xyz\\Desktop\\xyz\\xyz.JPG'
There is a lot of features with these types of filenames spread across a lot of (hosted) feature services, so i can't just change the names of the files.
It is in ArcGIS Online.
Does anybody have an idea of why it happens, a workaround or anything else?