laptop and a wrench

Bogue

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

Dernière publication: February 23, 2023 ArcGIS Pro
Numéro d’ID de bogue BUG-000154997
EnvoiJanuary 10, 2023
Dernière modificationOctober 7, 2024
S’applique àArcGIS Pro
Version trouvée3.0.3
Système d’exploitationN/A
Version du système d’exploitationN/A
StatutAs Designed

Informations supplémentaires

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.

Étapes pour reproduire

ID de bogue: BUG-000154997

Logiciel:

  • ArcGIS Pro

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement