laptop and a wrench

漏洞

The arcpy.env.workspace setting mistakenly references the active map layer instead of the target workspace parameter when the layer names match in ArcGIS Pro.

ArcGIS Pro
漏洞 ID 编号 BUG-000179061
已提交August 27, 2025
上次修改时间September 11, 2025
适用范围ArcGIS Pro
找到的版本3.4.3
操作系统Windows OS
操作系统版本N/A
状态Known Limit

附加信息

This behavior is as designed and is a known limitation. When passing only the name of a feature class to arcpy.Describe (and other functions or tools that accept a short name), it first looks for the feature class in the layers of the map. If no layer is found, it then searches in the arcpy.env.workspace. Many tools, functions, and user workflows are dependent on the software behaving this way. The documentation is updated to better represent this expected behavior. The best practice when writing scripts is to pass through the fully qualified path of the object to the function or tool. The path can be built from prior pieces of code: path = os.path.join(arcpy.env.workspace, ds, fc) arcpy.Describe(path)

解决办法

Use best practices when writing scripts by passing through the fully qualified path of the object to the function or tool. The path can be built from prior pieces of code: path = os.path.join(arcpy.env.workspace, ds, fc) arcpy.Describe(path)

重现步骤

漏洞 ID: BUG-000179061

软件:

  • ArcGIS Pro

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项