Publish python script containing umlauts as a Geoprocessing Service to ArcGIS Server via ArcGIS Pro is cut off

579
2
11-15-2022 06:01 AM
geowind
New Contributor

Hi everyone,

when I try to publish a python script containing umlauts as a Geoprocessing Service to the ArcGIS Standalone Server via ArcGIS Pro, the publishing process is successful (no error/warning), but the published script is cut off at the first umlaut.

The script I'm publishing:

 

import arcpy
# Hello Wörld
arcpy.AddMessage("Hello Wörld")

 

The published script ("\directories\arcgissystem\arcgisinput\TestPublishGP.GPServer\extracted\p20\testpublishgp\TestPublishGP.py") looks like this:

 

import arcpy
# Hello W

 

If I publish the same script via ArcMap 10.8.1 everything works just fine. We're switching to ArcGIS Pro, so using ArcMap is not an option.

ArcGIS-Server: 10.9.1
ArcGIS Pro: 2.8.6
Python: 3.7.10

How can i solve this problem?

0 Kudos
2 Replies
JohannesLindner
MVP Frequent Contributor

Does it work if you specify a coding that works with umlauts?

# -*- coding: cp1252 -*-

import arcpy
# ÄäÖöÜüß
arcpy.AddMessage("ÄäÖöÜüß")

Have a great day!
Johannes
0 Kudos
geowind
New Contributor

Hi Johannes,

thank you for your suggestion. I tried your script and unfortunately it didn't work.

The script I'm publishing:

# -*- coding: cp1252 -*-

import arcpy
# ÄäÖöÜüß
arcpy.AddMessage("ÄäÖöÜüß")

The published script ("\directories\arcgissystem\arcgisinput\TestPublishGP.GPServer\extracted\p20\testpublishgp\TestPublishGP.py") looks like this:

# -*- coding: utf-8 -*-

import arcpy
# 

Interestingly he changes the encoding string during/after the publishing process to utf-8. 
I am surprised that the comments aren't ignored. (The script is cut off at the first umlaut in the comment in line 4).

Greetings
geowind

PS I don't know why this post has extra paragraphs at the end, I can't remove them 😀

 

 

0 Kudos