laptop and a wrench

Bug

When exporting and executing a Python script using the 'Calculate Field' tool in ArcGIS Pro, the following error message is returned, “SyntaxError: EOL while scanning string literal.”

Last Published: September 14, 2020 ArcGIS Pro
Bug ID Number BUG-000133395
SubmittedAugust 27, 2020
Last ModifiedJuly 11, 2025
Applies toArcGIS Pro
Version found2.6
Operating SystemWindows OS
Operating System Version10.0 64 Bit
Version Fixed2.7
StatusFixed

Workaround

The issue can be resolved by getting the second line of the tool, which is return value", “TEXT”) appended after the first line.

For example, instead of arcpy.management.CalculateField("World Continents", "CONTINENT", "test(!OBJECTID!)", "PYTHON3", r"def test(value):

return value", "TEXT") , the code lines must look like the following: arcpy.management.CalculateField("World Continents",

"CONTINENT", "test(!OBJECTID!)", "PYTHON3", r"def test(value):return value", "TEXT")

Steps to Reproduce

Bug ID: BUG-000133395

Software:

  • ArcGIS Pro

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options