laptop and a wrench

Bug

Changes to an embedded Python script in a Python script tool do not persist after restarting ArcGIS.

Last Published: August 25, 2014 ArcGIS for Desktop
Bug ID Number NIM091684
SubmittedMay 15, 2013
Last ModifiedJune 5, 2024
Applies toArcGIS for Desktop
Version found10.1
Operating SystemWindows OS
Operating System Version7
Version Fixed10.2.1
StatusFixed

Description

After embedding a Python script, edits made by right-clicking the script tool and clicking 'Edit' do not persist after closing the ArcGIS session. This means that changes made in this environment are lost when closing the application.

Cause

When a script tool is accessed, it creates a temporary Python script file in a Windows Temp directory. Upon closing the application, this directory is cleared. When edits are made to the script, they are applied to the temporary file. These changes are not posted back to the original code. Therefore, any changes that are made to the script are temporary to the session and do not apply to the actual source script from which the temporary file was created. This has been documented as NIM091684.

Workaround

To make permanent changes to the source code, export the script by right-clicking it and clicking Export Script, make changes to the exported script, and import the script back if desired.

    Steps to Reproduce

    Bug ID: NIM091684

    Software:

    • ArcGIS for Desktop

    Get notified when the status of a bug changes

    Download the Esri Support App

    Related Information

    Discover more on this topic

    Get help from ArcGIS experts

    Contact technical support

    Download the Esri Support App

    Go to download options