laptop and a wrench

漏洞

The ArcPy layer.labelClasses.expression method does not accept properly formatted strings if they contain multiple quotation marks.

上次发布: June 24, 2015 ArcGIS for Desktop
漏洞 ID 编号 BUG-000088225
已提交June 9, 2015
上次修改时间June 5, 2024
适用范围ArcGIS for Desktop
找到的版本10.3.1
状态Will Not Be Addressed

附加信息

This is a known behavior. The additional quotes are needed to make sure the Python window reads the field 'FID' and not a variable in a list.

解决办法

The additional quotes are needed to properly form the string to be set as the expression. Without them it will not read 'FID' as a field. Instead, the method inteprates as the user is trying to use a variable in a list, because that is what that means in a Python interpreter. In the expression dialog, it does not expect the additional quotes because the Python parser understands that the brackets around a word indicate a field. Use triple quotes around the expression to maintain the full string: layer.labelClasses[0].expression = ''' "<CLR red='255'><FNT size = '17'>" + [OBJECTID] + "</FNT></CLR>" '''

重现步骤

漏洞 ID: BUG-000088225

软件:

  • ArcGIS for Desktop

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

下载 Esri 支持应用程序

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

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项