Python toolbox doesn not work in ArcMap with italian language setting

1327
10
Jump to solution
02-22-2017 09:05 AM
AlessandroValra
Occasional Contributor III

I have created a Python toolbox which works in my and others' ArcMap 10.4.1. Today I tried it on another ArcMap installation (always 10.4.1), and I get a little-red-cross icon on top of the python script (tool) inside the python toolbox from within the catalog window. I noticed that AcrMap is in Italian in this installation and if I switch to english everything works just fine. Would this be a bug? Does anyone else have occurred in such error? The error is related to the "GetParameterInfo" of the toolbox. However, this same toolbox works on other ArcMap 10.4.1... The error is the one below:

Traceback (most recent call last):
  File "<string>", line 60, in getParameterInfo
  File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\arcobjects\mixins.py", line 299, in __init__
    setattr(self, attrib, attribvalue)
  File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\arcobjects\_base.py", line 89, in _set
    return setattr(self._arc_object, attr_name, cval(val))
ValueError: ParameterObject: Valore input non valido per propriet\xe0 DataType

0 Kudos
1 Solution

Accepted Solutions
AlessandroValra
Occasional Contributor III

I had the time to test with older versions and this still does not work. From the italian ESRI support they give me the right solution now: apparently, the DataType of one of the parameters was set somehow to work only with English version. In my specific case, I had a DataType set to "Table". Changing this to "DETable" made the whole tool work also with italian settings. So, apparently, looking at "Defining parameter data types in a Python toolbox" help page, if I insert the keyword datatype, instead of the Data Type (look at the table in the page to understand) it works, otherwise it doesn't. I wonder if the "Caution" section in the same page is saying just that... It reads "The use of keywords for parameter data types was introduced at 10.1, service pack 1. Parameter descriptions can still be used but are not localized and cannot be used for different locales.". Hope this can be of help for anybody.

View solution in original post

0 Kudos
10 Replies
DanPatterson_Retired
MVP Esteemed Contributor

check your scripts... because of internalization and codepage issues, it is a good idea to throw this as the first line

# -*- coding: UTF-8 -*-
0 Kudos
AlessandroValra
Occasional Contributor III

Hi Dan and thanks for the response,

Unfortunately, that didn't seem to solve the issue. I have that line of code inserted at the top of my ".pyt" and the scripts imported, but I still have the same problem. Any other idea? Is anyone else experiencing the same issue? It is important for me to understand how to fix this, as I should avoid saying "Change the language settings" to all the users of my toolbox... Thanks.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

I can only suggest that you forward this to support in Italy.  If it has been noted by others, it would likely been brought to their attention.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Alessandro

Valore input non valido per propriet\xe0 DataType

My daughter said this meant 'the input value is not valid for property: Datatype... (my translation of her translation) which was my guess (but I defer to those that speak the language).  She wondered what the \xe0 was there for since it should be proprietà ... the à isn't being translated by either arcmap (possible) or the computer (possible too).  So the linquistically challenged will defer to those that can deal with the appropriate codepage settings

0 Kudos
AlessandroValra
Occasional Contributor III

Ok so if I understand correctly (but I might be wrong), this seems not a problem of my code (indeed there's no trace of any 'proprietà' in it), but of the way ArcMap or the computer language settings/translation process. Meanwhile, I can confirm my code works if I switch to english settings in the ArcGIS Administrator. I will write to ESRI Italia support to hopefully investigate into this. Thanks again Dan for your kind feedback.

0 Kudos
AlessandroValra
Occasional Contributor III

Just to add some detail. This specific python toolbox is calling other scripts. Another python toolbox I have, where the code is within the "execute" function inside the same pyt, is working fine both with english and italian settings.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Alessandro, I might be wrong, but since it was unable to translate the 'proprietà' correctly, there may be a problem.  I found some vague reference to codepage 1125 unable to translate some accented characters properly even though it seems to be showing the rest of the case properly... hence her question about the \xe0 in place of it.  Apparently that code page is some Windows variant/subset of utf-8 .  At this stage, a call to esri Italia is in order.. I would venture that this has been seen before... perhaps a miscommunication between the main and called scripts.  Good luck

0 Kudos
AlessandroValra
Occasional Contributor III

Thank you again Dan,

so I wrote to ESRI Italian support and they told me that this might be due to my version of ArcGIS (10.4.1) being too new, and so there will probably be a patch release to solve this issue. I didn't test if this same error occur in older releases, but at least I received an official answer, and will wait for a patch in the (hopefully near) future.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Hope it works out... but in the interim,  check it out in 10.5 to see if it was a transient glitch

0 Kudos