laptop and a wrench

漏洞

An OSError occurs when instantiating a LayerFile object after changing the directory and not using the full path to the layer file (.lyrx) in ArcGIS Pro 3.0.

上次发布: October 1, 2022 ArcGIS Pro
漏洞 ID 编号 BUG-000151539
已提交August 12, 2022
上次修改时间February 7, 2025
适用范围ArcGIS Pro
找到的版本3.0
操作系统N/A
操作系统版本N/A
状态Non-Reproducible

附加信息

This issue is non-reproducible. Use the following modified script to join the newly changed directory so the LYRX can be found correctly: import os import arcpy print(f'Currently in {os.getcwd()}\n') fldr_scratch = os.path.join(os.getcwd(), 'fldr_scratch') os.chdir(fldr_scratch) print(f'Now in {os.getcwd()}\n') layer = arcpy.mp.LayerFile(os.path.join(fldr_scratch, 'Boundary.lyrx')) print(layer.filePath)

解决办法

Use the full path to the layer file (.lyrx) as a string or by using the os.path.join() function.

重现步骤

漏洞 ID: BUG-000151539

软件:

  • ArcGIS Pro

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

下载 Esri 支持应用程序

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

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项