<?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: Pyton Window workspace path character limit? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/pyton-window-workspace-path-character-limit/m-p/651167#M50696</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is there a limit to the number of characters in a workspace path when using the Pyton Window?&lt;BR /&gt;&lt;BR /&gt;This example from a tutorial works fine:&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; mxd.replaceWorkspaces("D:\Student\PythonDesktop10_0\Data\Austin_test.gdb",&lt;BR /&gt;"FILEGDB_WORKSPACE", &lt;BR /&gt;"D:\Student\PythonDesktop10_0\Data\Westerville.gdb",&lt;BR /&gt;"FILEGDB_WORKSPACE")&lt;BR /&gt;&lt;BR /&gt;But this does not:&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; mxd.replaceWorkspaces("D:\Student\PythonDesktop10_0\Data\Westerville.gdb", &lt;BR /&gt;"FILEGDB_WORKSPACE", &lt;BR /&gt;"W:\AEP\127142_Opossum_Creek_Smith_Mtn\PER\Environmental\GIS\Data\temp\Austin_test.gdb",&lt;BR /&gt;"FILEGDB_WORKSPACE")&lt;BR /&gt;&lt;BR /&gt;Runtime error &amp;lt;type 'exceptions.ValueError'&amp;gt;: MapDocObject: Unexpected error&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If those were the example paths given they are setting you up for failure. You bombed here &lt;/SPAN&gt;&lt;STRONG&gt;\temp&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;\t in a string is read as a tab. To avoid this issue use double \\, / or the easiest method in my opinion, the r tag before your string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mxd.replaceWorkspaces(r"D:\Student\PythonDesktop10_0\Data\Westerville.gdb",&amp;nbsp; "FILEGDB_WORKSPACE",&amp;nbsp; r"W:\AEP\127142_Opossum_Creek_Smith_Mtn\PER\Environmental\GIS\Data\temp\Austin_test.gdb", "FILEGDB_WORKSPACE")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can read more about string literals, what they do and how to avoid them here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://docs.python.org/reference/lexical_analysis.html#string-literals" rel="nofollow" target="_blank"&gt;http://docs.python.org/reference/lexical_analysis.html#string-literals&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Sep 2012 19:28:58 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2012-09-26T19:28:58Z</dc:date>
    <item>
      <title>Pyton Window workspace path character limit?</title>
      <link>https://community.esri.com/t5/python-questions/pyton-window-workspace-path-character-limit/m-p/651166#M50695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a limit to the number of characters in a workspace path when using the Pyton Window?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This example from a tutorial works fine:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; mxd.replaceWorkspaces("D:\Student\PythonDesktop10_0\Data\Austin_test.gdb",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"FILEGDB_WORKSPACE", &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"D:\Student\PythonDesktop10_0\Data\Westerville.gdb",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"FILEGDB_WORKSPACE")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But this does not:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; mxd.replaceWorkspaces("D:\Student\PythonDesktop10_0\Data\Westerville.gdb", &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"FILEGDB_WORKSPACE", &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"W:\AEP\127142_Opossum_Creek_Smith_Mtn\PER\Environmental\GIS\Data\temp\Austin_test.gdb",&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;"FILEGDB_WORKSPACE")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Runtime error &amp;lt;type 'exceptions.ValueError'&amp;gt;: MapDocObject: Unexpected error&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 19:17:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyton-window-workspace-path-character-limit/m-p/651166#M50695</guid>
      <dc:creator>AustinStreetman</dc:creator>
      <dc:date>2012-09-26T19:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Pyton Window workspace path character limit?</title>
      <link>https://community.esri.com/t5/python-questions/pyton-window-workspace-path-character-limit/m-p/651167#M50696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is there a limit to the number of characters in a workspace path when using the Pyton Window?&lt;BR /&gt;&lt;BR /&gt;This example from a tutorial works fine:&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; mxd.replaceWorkspaces("D:\Student\PythonDesktop10_0\Data\Austin_test.gdb",&lt;BR /&gt;"FILEGDB_WORKSPACE", &lt;BR /&gt;"D:\Student\PythonDesktop10_0\Data\Westerville.gdb",&lt;BR /&gt;"FILEGDB_WORKSPACE")&lt;BR /&gt;&lt;BR /&gt;But this does not:&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt; mxd.replaceWorkspaces("D:\Student\PythonDesktop10_0\Data\Westerville.gdb", &lt;BR /&gt;"FILEGDB_WORKSPACE", &lt;BR /&gt;"W:\AEP\127142_Opossum_Creek_Smith_Mtn\PER\Environmental\GIS\Data\temp\Austin_test.gdb",&lt;BR /&gt;"FILEGDB_WORKSPACE")&lt;BR /&gt;&lt;BR /&gt;Runtime error &amp;lt;type 'exceptions.ValueError'&amp;gt;: MapDocObject: Unexpected error&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If those were the example paths given they are setting you up for failure. You bombed here &lt;/SPAN&gt;&lt;STRONG&gt;\temp&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;\t in a string is read as a tab. To avoid this issue use double \\, / or the easiest method in my opinion, the r tag before your string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mxd.replaceWorkspaces(r"D:\Student\PythonDesktop10_0\Data\Westerville.gdb",&amp;nbsp; "FILEGDB_WORKSPACE",&amp;nbsp; r"W:\AEP\127142_Opossum_Creek_Smith_Mtn\PER\Environmental\GIS\Data\temp\Austin_test.gdb", "FILEGDB_WORKSPACE")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can read more about string literals, what they do and how to avoid them here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A class="jive-link-external-small" href="http://docs.python.org/reference/lexical_analysis.html#string-literals" rel="nofollow" target="_blank"&gt;http://docs.python.org/reference/lexical_analysis.html#string-literals&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 19:28:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/pyton-window-workspace-path-character-limit/m-p/651167#M50696</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-09-26T19:28:58Z</dc:date>
    </item>
  </channel>
</rss>

