<?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 Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189122#M14534</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm late to this, but if the goal is to simply remove the escaped chars, try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;re.sub(r"\s", " ", my_dict['key1'])&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;nbsp;'test is a string with some escaped characters such newlines'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the comment:&amp;nbsp;&lt;A class="link-titled" href="http://stackoverflow.com/questions/24646461/python-why-does-str-strip-automatically-removes-all-the-escape-characters" title="http://stackoverflow.com/questions/24646461/python-why-does-str-strip-automatically-removes-all-the-escape-characters"&gt;string - Python - Why does str.strip() automatically removes all the escape characters? - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Jan 2017 22:13:27 GMT</pubDate>
    <dc:creator>KevinHibma</dc:creator>
    <dc:date>2017-01-05T22:13:27Z</dc:date>
    <item>
      <title>arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189107#M14519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a geoservice that get some text stored from a table in order to return a json string to a javascript client. However, the &lt;CODE&gt;arcpy.SetParameter()&lt;/CODE&gt; seems to have problem to returns the escaped new lines character (&lt;CODE&gt;\\n&lt;/CODE&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;my_dict &lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"key1"&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;"test is a string with\nsome escaped characters\nsuch newlines"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt; 
my_json &lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt; json&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;dumps&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;my_dict&lt;/SPAN&gt;&lt;SPAN class=""&gt;)
&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;my_json&lt;/SPAN&gt;&lt;SPAN class=""&gt;)
&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;'{"key1": "test is a string with\\nsome escaped characters\\nsuch newlines"}'

&lt;/SPAN&gt;&lt;SPAN class=""&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;SetParameter&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt; my_json&lt;/SPAN&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the javascript console the response is the following which is not a valid json:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"key1"&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;"test is a string with
some escaped characters
such newlines"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}

&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there a solution?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:31:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189107#M14519</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2021-12-11T09:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189108#M14520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;does the parameter that you are setting normally accept multiline input? perhaps setparameter removes what isn't needed or required&lt;/P&gt;&lt;P&gt;raw formatting doesn't work either I suspect either&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Dec 2016 20:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189108#M14520</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-12-19T20:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189109#M14521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;It seems its an issue with the SetParameter(). I can't find any solution for this case. Is this should be reported to Esri support?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 12:51:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189109#M14521</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2016-12-20T12:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189110#M14522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well I can't figure it out... so it either something we are missing or something wrong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 12:56:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189110#M14522</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-12-20T12:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189111#M14523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try raw formatting the string like Dan suggested?&amp;nbsp; If so, what were the results?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Dec 2016 16:29:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189111#M14523</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-12-20T16:29:01Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189112#M14524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using raw strings does not help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;my_dict &lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"key1"&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt; r&lt;/SPAN&gt;&lt;SPAN class=""&gt;"test is a string with\nsome escaped characters\nsuch newlines"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;SPAN class=""&gt; 
my_json &lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt; json&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;dumps&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;my_dict&lt;/SPAN&gt;&lt;SPAN class=""&gt;)
&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;my_json&lt;/SPAN&gt;&lt;SPAN class=""&gt;)
&lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;'{"key1": "test is a string with\\\\nsome escaped characters\\\\nsuch newlines"}'

&lt;/SPAN&gt;&lt;SPAN class=""&gt;arcpy&lt;/SPAN&gt;&lt;SPAN class=""&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;SetParameter&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;0&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;SPAN class=""&gt; my_json&lt;/SPAN&gt;&lt;SPAN class=""&gt;)


Same problem with the json in the javascript console:
&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/CODE&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;SPAN class=""&gt;"key1"&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;SPAN class=""&gt;"test is a string with
some escaped characters
such newlines"&lt;/SPAN&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;CODE&gt;&lt;SPAN class=""&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:31:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189112#M14524</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2021-12-11T09:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189113#M14525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;my_dict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"key1"&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"test is a string with\\nsome escaped characters\\nsuch newlines"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; &lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 13:57:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189113#M14525</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-12-21T13:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189114#M14526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will be interesting if escaping the new lines works.&amp;nbsp; I won't be totally surprised if it doesn't.&amp;nbsp; There are at least a couple geoprocessing tools that refuse to work properly with Python new lines.&amp;nbsp; I usually find a workaround, but I am not sure what that would be in this case.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 14:07:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189114#M14526</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-12-21T14:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189115#M14527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@James Crandall : This is not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@Joshua Bixby : The work around I have found is to replace the \\n with other characters, for instance &amp;lt;br&amp;gt; before passing it into the SetParameter() and then in the javavscript I replace back the &amp;lt;br&amp;gt; with \n. Off course that's not really satisfying to proceed this way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 14:10:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189115#M14527</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2016-12-21T14:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189116#M14528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kludgy, but it seems to work for you.&amp;nbsp; I would open an Esri Support case to log a bug, which this seems to be, but whether stuff like this gets fixed or not is a total crap shoot from my experience.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 14:15:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189116#M14528</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-12-21T14:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189117#M14529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure if this is correct for the .dumps() but&amp;nbsp;try setting strict param:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;my_json &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dumps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;my_dict&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; strict&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 14:24:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189117#M14529</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-12-21T14:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189118#M14530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@James Crandall : There is no such parameter in json.dumps(), at least in python 2.7&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 14:29:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189118#M14530</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2016-12-21T14:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189119#M14531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Turn the dictionary into a string, then try to load that with the strict param:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;my_dict &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'{"key1" : "test is a string with\\nsome escaped characters\\nsuch newlines"}'&lt;/SPAN&gt;
my_jsonloads &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;loads&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;my_dict&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; strict&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
my_json &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; json&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;dumps&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;my_jsonloads&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;my_json&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:32:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189119#M14531</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T09:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189120#M14532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&amp;gt;&amp;gt;&amp;gt; import json
&amp;gt;&amp;gt;&amp;gt; dir(json)
['JSONDecodeError', 'JSONDecoder', 'JSONEncoder', '__all__', '__author__', 
'__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', 
'__package__', '__path__', '__spec__', '__version__', '_default_decoder', 
'_default_encoder', 'decoder', 'dump', 'dumps', 'encoder', 'load', 'loads',
 'scanner']

&amp;gt;&amp;gt;&amp;gt; # above in python 3.5
&amp;gt;&amp;gt;&amp;gt; 
&amp;gt;&amp;gt;&amp;gt; # now over to old-school
&amp;gt;&amp;gt;&amp;gt; import json
&amp;gt;&amp;gt;&amp;gt; dir(json)
['JSONDecoder', 'JSONEncoder', '__all__', '__author__', '__builtins__', 
'__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', 
'_default_decoder', '_default_encoder', 'decoder', 'dump', 'dumps', 'encoder',
 'load', 'loads', 'scanner']
&amp;gt;&amp;gt;&amp;gt; # above in python 2.7
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:32:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189120#M14532</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T09:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189121#M14533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;FYI: this still produces the OP's result.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 18:18:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189121#M14533</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2016-12-21T18:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189122#M14534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm late to this, but if the goal is to simply remove the escaped chars, try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;re.sub(r"\s", " ", my_dict['key1'])&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;nbsp;'test is a string with some escaped characters such newlines'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the comment:&amp;nbsp;&lt;A class="link-titled" href="http://stackoverflow.com/questions/24646461/python-why-does-str-strip-automatically-removes-all-the-escape-characters" title="http://stackoverflow.com/questions/24646461/python-why-does-str-strip-automatically-removes-all-the-escape-characters"&gt;string - Python - Why does str.strip() automatically removes all the escape characters? - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jan 2017 22:13:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189122#M14534</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2017-01-05T22:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.SetParameter() - Problem passing escaped string as geoprocessing service output</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189123#M14535</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, but the aim is to keep the the newlines. Removing it is not wanted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jan 2017 18:35:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-setparameter-problem-passing-escaped-string/m-p/189123#M14535</guid>
      <dc:creator>MaximeDemers</dc:creator>
      <dc:date>2017-01-19T18:35:06Z</dc:date>
    </item>
  </channel>
</rss>

