laptop and a wrench

Bug

The getcwd() Python method returns the incorrect current working directory of a process when the project is launched from the Start menu.

Last Published: February 23, 2023 ArcGIS Pro
Bug ID Number BUG-000154997
SubmittedJanuary 10, 2023
Last ModifiedOctober 7, 2024
Applies toArcGIS Pro
Version found3.0.3
Operating SystemN/A
Operating System VersionN/A
StatusAs Designed

Additional Information

When an application is launched either from the start menu or from the cmd.exe session, there is a well-established 'current directory' behavior. Python simply returns whatever the application's current directory is with os.getcwd().   iPython notebooks do not provide a way to determine the current running .ipynb, refer to the discussion at https://github.com/ipython/ipython/issues/10123 If the intent is to query the current ArcGIS Pro in which the Python code is running, use the 'arcpy.mp.ArcGISProject("CURRENT").homeFolde' command.

Steps to Reproduce

Bug ID: BUG-000154997

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