<?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: Create Geodatabase Connection mishandles escape characters in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46409#M3735</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;​, I'll use this thread to advocate for it with our product team. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 May 2016 20:35:11 GMT</pubDate>
    <dc:creator>ChristianWells</dc:creator>
    <dc:date>2016-05-12T20:35:11Z</dc:date>
    <item>
      <title>Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46399#M3725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Create Geodatabase Connection fails when passing an instance parameter containing escape characters. For instance, passing 'nomsqapp4d\nomsqapp4d' fails because the '\n' is interpreted inside the arcpy tool code as a new line. This can be verified by calling the function via Python and through running the tool itself in ArcGIS Desktop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the example instance name is a standard company format and can't be changed. Is there any way around this issue or should this be logged as a bug? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 May 2016 18:51:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46399#M3725</guid>
      <dc:creator>ShaneBuscher</dc:creator>
      <dc:date>2016-05-11T18:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46400#M3726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you have to use 'raw' notation&lt;/P&gt;&lt;P&gt;notice the difference that the 'r' makes to how a string is handled in printing and backslashes are handled&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;gt;&amp;gt;&amp;gt; a = 'nomsqapp4d\nomsqapp4d'
&amp;gt;&amp;gt;&amp;gt; b = r'nomsqapp4d\nomsqapp4d'
&amp;gt;&amp;gt;&amp;gt; a
'nomsqapp4d\nomsqapp4d'
&amp;gt;&amp;gt;&amp;gt; b
'nomsqapp4d\\nomsqapp4d'
&amp;gt;&amp;gt;&amp;gt; print(a)
nomsqapp4d
omsqapp4d
&amp;gt;&amp;gt;&amp;gt; print(b)
nomsqapp4d\nomsqapp4d&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:49:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46400#M3726</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-10T21:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46401#M3727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately that has been tried without success. The correct db instance value is being passed into Create Geodatabase Connection function. The heart of the issue is the function internally converts nomsqapp4d\nomsqapp4d to a string with a line feed, which I have no control over.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 13:12:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46401#M3727</guid>
      <dc:creator>ShaneBuscher</dc:creator>
      <dc:date>2016-05-12T13:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46402#M3728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting, I see the same thing with some dummy connections I just made.&amp;nbsp; This is definitely a bug, I encourage you to contact Esri Support.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried numerous "workarounds" and found something completely ugly that works, i.e., double up the backslash and 'n' when using raw strings:&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14630600618521312" data-renderedposition="86_8_1203_16" jivemacro_uid="_14630600618521312" modifiedtitle="true"&gt;&lt;P&gt;r'nomsqapp4d\\nnomsqapp4d'&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 13:34:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46402#M3728</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-05-12T13:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46403#M3729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
path = os.path.normpath('nomsqapp4d\nomsqapp4d')
path
'nomsqapp4d\nomsqapp4d'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 21:49:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46403#M3729</guid>
      <dc:creator>WesMiller</dc:creator>
      <dc:date>2021-12-10T21:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46404#M3730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This isn't a Python problem, it is a problem with the tool itself, i.e., generating a valid string isn't the problem, getting the tool to use the valid string is the problem. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 14:46:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46404#M3730</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-05-12T14:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46405#M3731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does a capital 'N' work? Other tools have had this problem too, such as the Create Database user tool, where DOMAIN\tim doesn't work properly. However, I found that switching the value to a capital letter, allowed me to move forward, as \n or \t is an escape but not \T or \N. In reviewing the current defects within Esri Technical Support, the following defect sounds like the issue: &lt;A href="http://support.esri.com/en/bugs/nimbus/TklNMDgyNjc2" title="http://support.esri.com/en/bugs/nimbus/TklNMDgyNjc2"&gt;NIM082676 - Unexpected behavior occurs when using input parame..&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But as &lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;​ said, please log an Esri Technical Support case so we can attach you to this defect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 17:19:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46405#M3731</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2016-05-12T17:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46406#M3732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;raw formatting... \t ... arcpy hmmmm &lt;A _jive_internal="true" href="https://community.esri.com/message/608012#comment-608012" title="https://community.esri.com/message/608012#comment-608012"&gt;https://community.esri.com/message/608012#comment-608012&lt;/A&gt; &lt;/P&gt;&lt;P&gt;two does not make a trend I hope?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 18:39:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46406#M3732</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2016-05-12T18:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46407#M3733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Christian for the workaround and Dan for the ESRI bug reference. Using all caps does the trick. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 18:44:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46407#M3733</guid>
      <dc:creator>ShaneBuscher</dc:creator>
      <dc:date>2016-05-12T18:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46408#M3734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We should all get used to the workaround because if the bug hasn't been touched in 4 years, I doubt it will miraculously get addressed anytime soon.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 20:32:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46408#M3734</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-05-12T20:32:35Z</dc:date>
    </item>
    <item>
      <title>Re: Create Geodatabase Connection mishandles escape characters</title>
      <link>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46409#M3735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/3420"&gt;Joshua Bixby&lt;/A&gt;​, I'll use this thread to advocate for it with our product team. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 May 2016 20:35:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-geodatabase-connection-mishandles-escape/m-p/46409#M3735</guid>
      <dc:creator>ChristianWells</dc:creator>
      <dc:date>2016-05-12T20:35:11Z</dc:date>
    </item>
  </channel>
</rss>

