laptop and a wrench

Erro

When running a Python code that uses ArcGIS API for Python to query and export ArcGIS Server logs to a CSV file, the code in the arcgis module returns an error instead of writing to a CSV file. There are three locations in the ArcGIS module where the offending code is written: - arcgis\gis\mission\_logs.py - arcgis\gis\nb\_logs.py - arcgis\gis\server\admin\_logs.py This has been validated using Python 3.7.9, ArcGIS site package version 1.8.3, and ArcGIS Enterprise 10.9.

Última Publicação: January 19, 2022 ArcGIS API for Python
Número de ID do Erro BUG-000141231
EnviadoJuly 6, 2021
Última ModificaçãoJune 5, 2024
Aplica-se àArcGIS API for Python
Versão encontrada1.8.3
Sistema OperacionalWindows OS
Versão do Sistema Operacional10.0 64 Bit
Versão Fixa1.9.2
StatusFixed

Solução Provisória

The main offending line (line 270 in arcgis\gis\server\admin\_logs.py) reads:

with open(name=out_path, mode='wb') as f: 

Edit it to:

with open(file=out_path, mode='w') as f:

While the output after changing this is successful, there is a new line after each entry.  This is a Windows specific issue. To resolve this, change line 270 to:

with open(name=out_path, mode='w', newline='') as f:Exporting the logs for Notebook Server after making the same adjustments to the respective code (in arcgis\gis\nb\_logs.py) requires additional 2 lines to be added in order  for it to successfully run. The following import statements are added in line 4:

from datetime import datetime

import csv

 

 

 

Etapas para Reproduzir

ID do Erro: BUG-000141231

Software:

  • ArcGIS API for Python

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download