Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diacritics in an ArcGIS Survey 123 Form result in a failure during cloning #1761

Open
shane-pienaar-gbs opened this issue Feb 22, 2024 · 1 comment
Assignees
Labels

Comments

@shane-pienaar-gbs
Copy link

shane-pienaar-gbs commented Feb 22, 2024

Describe the bug
During clone_items() of an ArcGIS Survey123 Form, if a question has any diacritics like macrons (e.g. the ā in Māori) cloning fails.

To Reproduce
Steps to reproduce the behavior:

Publish a Survey to ArcGIS Portal, with a question containing diacritics.
Clone the Form using the normal ArcGIS Python API workflow.

error:
_ItemCreateException: ("Failed to create Form X: Failed to updateX: 'charmap' codec can't decode byte 0x81 in position 18347: character maps to ", <Item title:"X" type:Form owner:admin>)

Expected behavior
The Form should clone.

NOTE: If I monkey patch the ArcGIS Python API as follows, cloning works as expected.
..\site-packages\arcgis\_impl\common_clone.py#L5279
elif path.lower() == "form.json":
with open(os.path.join(zip_dir, path), "r", encoding="utf8") as file:
form_json = file.read()

Platform (please complete the following information):

  • OS: Windows
  • Browser: NA
  • Python API Version: 2.2.0.1

Additional context
None at this time

@shane-pienaar-gbs
Copy link
Author

@nparavicini7. FYI, at ArcGIS Python API 2.3.0 a similar issue now occurs at line common_clone.py#L5313:
with open(os.path.join(zip_dir, path), "w") as file:
need to be changed to
with open(os.path.join(zip_dir, path), "w", encoding="utf8") as file:
to get diacritics to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants