<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Problems with sharing web tools in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1077128#M61642</link>
    <description>&lt;P&gt;I issued a problem while sharing web tool to a corporate ArcGis server.&lt;/P&gt;&lt;P&gt;I created a python script that works perfectly locally and passes preposting analysis but when I share it and try to run as a service, I get an error:&lt;/P&gt;&lt;P&gt;“line 98 SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf1 in position 8: invalid continuation byte”&lt;/P&gt;&lt;P&gt;When I downloaded file from server’s directory I saw no syntaxis problems but I found out that in my code some strings replaced by “g_ESRI_variable_”s. That are:&lt;/P&gt;&lt;P&gt;1.Pathes to projected data – it was replaced correctly.&lt;/P&gt;&lt;P&gt;2.Field mapping string – long string and it have been replaced incorrectly. Part of a spring just disappeared.&lt;/P&gt;&lt;LI-CODE lang="python"&gt; #Field maping string to map fields while copy landplots
    copy_class_map_field = 'GlobalID "GlobalID" false false true 38 GlobalID 0 0,First,#,DBO.Terra_landplots_Layer,GlobalID,-1,-1;id_accounted "id_accounted" true true false 4 Long 0 10,First,#,DBO.Terra_landplots_Layer,id_accounted,-1,-1;Kluster_name "Kluster_name" true true false 70 Text 0 0,First,#,DBO.Terra_landplots_Layer,Kluster_name,0,70;District "District" true true false 70 Text 0 0,First,#,DBO.Terra_landplots_Layer,District,0,70;Region "Region" true true false 70 Text 0 0,First,#,DBO.Terra_landplots_Layer,Region,0,70;Vilage_consil "Vilage_consil" true true false 100 Text 0 0,First,#,DBO.Terra_landplots_Layer,Vilage_consil,0,100;Vilage "Vilage" true true false 70 Text 0 0,First,#,DBO.Terra_landplots_Layer,Vilage,0,70;Square "Square" true true false 8 Double 8 38,First,#,DBO.Terra_landplots_Layer,Square,-1,-1;Square_second_cat "Square_second_cat" true true false 8 Double 8 38,First,#,DBO.Terra_landplots_Layer,Square_second_cat,-1,-1;In_of_field_persent "In_of_field_persent" true true false 8 Double 8 38,First,#,DBO.Terra_landplots_Layer,In_of_field_persent,-1,-1'

    #Field maping string to map fields while perform spatial join cliped landplots and fields
    spatial_join_map_field = 'GlobalID "GlobalID" true false false 38 GlobalID 0 0,First,#,memory\\worked,GlobalID,-1,-1;id_accounted " id_accounted " true true false 4 Long 0 10,First,#,memory\\worked,id_accounted,-1,-1;Kluster_name "Kluster_name " true true false 2147483647 Text 0 0,First,#,memory\\worked,Kluster_name,0,2147483647;District "District" true true false 2147483647 Text 0 0,First,#,memory\\worked,District,0,2147483647;Region "Region" true true false 2147483647 Text 0 0,First,#,memory\\worked,Region,0,2147483647;Vilage_consil "Vilage_consil" true true false 2147483647 Text 0 0,First,#,memory\\worked,Vilage_consil,0,2147483647;Vilage "Vilage" true true false 2147483647 Text 0 0,First,#,memory\\worked,Vilage,0,2147483647;Square "Square" true true false 8 Double 8 38,First,#,memory\\worked,Square,-1,-1;Square_second_cat "Square_second_cat" true true false 8 Double 8 38,First,#,memory\\worked,Square_second_cat,-1,-1;In_of_field_persent "In_of_field_persent" true true false 8 Double 8 38,First,#,memory\\worked,In_of_field_persent,-1,-1;ZD_1_GlobalID "ZD_1_GlobalID" true true false 38 Guid 0 0,First,#,memory\\worked,ZD_1_GlobalID,-1,-1;Name "Name" true true false 255 Text 0 0,First,#,C:\\Users\\d.lukash\\Documents\\ArcGIS\\Projects\\Landplot_manadgment\\T3ADF.sde\\T1.DBO.Fields_14,Name,0,255'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;replaced by&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Esri start of added variables
g_ESRI_variable_1 = 'Terra_landplots_Layer,Square_second_cat,-1,-1;In_of_field_persent "In_of_field_persent" true true false 8 Double 8 38,First,#,DBO.Terra_landplots_Layer,In_of_field_persent,-1,-1'
g_ESRI_variable_2 = 'DBO.Fields_14,Name,0,255'

#Field maping string to map fields while copy landplots
copy_class_map_field = g_ESRI_variable_1

#Field maping string to map fields while perform spatial join cliped landplots and fields
spatial_join_map_field = g_ESRI_variable_2&lt;/LI-CODE&gt;&lt;P&gt;I do not know if Syntax Error have something common with this replacement. Is there some documentation about it? What I should do to get my code runs correctly on server after sharing.&lt;/P&gt;&lt;P&gt;Thanks for help!&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jul 2021 09:51:01 GMT</pubDate>
    <dc:creator>ДмитрийЛукаш</dc:creator>
    <dc:date>2021-07-09T09:51:01Z</dc:date>
    <item>
      <title>Problems with sharing web tools</title>
      <link>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1077128#M61642</link>
      <description>&lt;P&gt;I issued a problem while sharing web tool to a corporate ArcGis server.&lt;/P&gt;&lt;P&gt;I created a python script that works perfectly locally and passes preposting analysis but when I share it and try to run as a service, I get an error:&lt;/P&gt;&lt;P&gt;“line 98 SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf1 in position 8: invalid continuation byte”&lt;/P&gt;&lt;P&gt;When I downloaded file from server’s directory I saw no syntaxis problems but I found out that in my code some strings replaced by “g_ESRI_variable_”s. That are:&lt;/P&gt;&lt;P&gt;1.Pathes to projected data – it was replaced correctly.&lt;/P&gt;&lt;P&gt;2.Field mapping string – long string and it have been replaced incorrectly. Part of a spring just disappeared.&lt;/P&gt;&lt;LI-CODE lang="python"&gt; #Field maping string to map fields while copy landplots
    copy_class_map_field = 'GlobalID "GlobalID" false false true 38 GlobalID 0 0,First,#,DBO.Terra_landplots_Layer,GlobalID,-1,-1;id_accounted "id_accounted" true true false 4 Long 0 10,First,#,DBO.Terra_landplots_Layer,id_accounted,-1,-1;Kluster_name "Kluster_name" true true false 70 Text 0 0,First,#,DBO.Terra_landplots_Layer,Kluster_name,0,70;District "District" true true false 70 Text 0 0,First,#,DBO.Terra_landplots_Layer,District,0,70;Region "Region" true true false 70 Text 0 0,First,#,DBO.Terra_landplots_Layer,Region,0,70;Vilage_consil "Vilage_consil" true true false 100 Text 0 0,First,#,DBO.Terra_landplots_Layer,Vilage_consil,0,100;Vilage "Vilage" true true false 70 Text 0 0,First,#,DBO.Terra_landplots_Layer,Vilage,0,70;Square "Square" true true false 8 Double 8 38,First,#,DBO.Terra_landplots_Layer,Square,-1,-1;Square_second_cat "Square_second_cat" true true false 8 Double 8 38,First,#,DBO.Terra_landplots_Layer,Square_second_cat,-1,-1;In_of_field_persent "In_of_field_persent" true true false 8 Double 8 38,First,#,DBO.Terra_landplots_Layer,In_of_field_persent,-1,-1'

    #Field maping string to map fields while perform spatial join cliped landplots and fields
    spatial_join_map_field = 'GlobalID "GlobalID" true false false 38 GlobalID 0 0,First,#,memory\\worked,GlobalID,-1,-1;id_accounted " id_accounted " true true false 4 Long 0 10,First,#,memory\\worked,id_accounted,-1,-1;Kluster_name "Kluster_name " true true false 2147483647 Text 0 0,First,#,memory\\worked,Kluster_name,0,2147483647;District "District" true true false 2147483647 Text 0 0,First,#,memory\\worked,District,0,2147483647;Region "Region" true true false 2147483647 Text 0 0,First,#,memory\\worked,Region,0,2147483647;Vilage_consil "Vilage_consil" true true false 2147483647 Text 0 0,First,#,memory\\worked,Vilage_consil,0,2147483647;Vilage "Vilage" true true false 2147483647 Text 0 0,First,#,memory\\worked,Vilage,0,2147483647;Square "Square" true true false 8 Double 8 38,First,#,memory\\worked,Square,-1,-1;Square_second_cat "Square_second_cat" true true false 8 Double 8 38,First,#,memory\\worked,Square_second_cat,-1,-1;In_of_field_persent "In_of_field_persent" true true false 8 Double 8 38,First,#,memory\\worked,In_of_field_persent,-1,-1;ZD_1_GlobalID "ZD_1_GlobalID" true true false 38 Guid 0 0,First,#,memory\\worked,ZD_1_GlobalID,-1,-1;Name "Name" true true false 255 Text 0 0,First,#,C:\\Users\\d.lukash\\Documents\\ArcGIS\\Projects\\Landplot_manadgment\\T3ADF.sde\\T1.DBO.Fields_14,Name,0,255'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;replaced by&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Esri start of added variables
g_ESRI_variable_1 = 'Terra_landplots_Layer,Square_second_cat,-1,-1;In_of_field_persent "In_of_field_persent" true true false 8 Double 8 38,First,#,DBO.Terra_landplots_Layer,In_of_field_persent,-1,-1'
g_ESRI_variable_2 = 'DBO.Fields_14,Name,0,255'

#Field maping string to map fields while copy landplots
copy_class_map_field = g_ESRI_variable_1

#Field maping string to map fields while perform spatial join cliped landplots and fields
spatial_join_map_field = g_ESRI_variable_2&lt;/LI-CODE&gt;&lt;P&gt;I do not know if Syntax Error have something common with this replacement. Is there some documentation about it? What I should do to get my code runs correctly on server after sharing.&lt;/P&gt;&lt;P&gt;Thanks for help!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:51:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1077128#M61642</guid>
      <dc:creator>ДмитрийЛукаш</dc:creator>
      <dc:date>2021-07-09T09:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sharing web tools</title>
      <link>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1077142#M61648</link>
      <description>&lt;P&gt;show the relevant portion of the code would be useful...&lt;/P&gt;&lt;P&gt;it sounds like something wasn't "raw" encoded, like a file path&amp;nbsp; (eg&amp;nbsp; r"c:\path\to\something") or similar&lt;/P&gt;&lt;P&gt;the little 'r' is to be used for raw encoding&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:17:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1077142#M61648</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-07-09T09:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sharing web tools</title>
      <link>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1077159#M61650</link>
      <description>&lt;P&gt;You are right, with code looks better&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:52:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1077159#M61650</guid>
      <dc:creator>ДмитрийЛукаш</dc:creator>
      <dc:date>2021-07-09T09:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sharing web tools</title>
      <link>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1077164#M61651</link>
      <description>&lt;P&gt;No, it did not help(&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 11:14:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1077164#M61651</guid>
      <dc:creator>ДмитрийЛукаш</dc:creator>
      <dc:date>2021-07-09T11:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with sharing web tools</title>
      <link>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1288258#M67623</link>
      <description>&lt;P&gt;The problem was in cyrillic letter. NEVER use cyrilic letters in the tool you are gonna publish as a GP service&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 17:51:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/problems-with-sharing-web-tools/m-p/1288258#M67623</guid>
      <dc:creator>ДмитрийЛукаш</dc:creator>
      <dc:date>2023-05-11T17:51:19Z</dc:date>
    </item>
  </channel>
</rss>

