<?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: Using getpass in python console widget echos password in Windows (Python 2.7 or earlier) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/using-getpass-in-python-console-widget-echos/m-p/260173#M20023</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running ArcGIS 10.2.2 with Python 2.7.5 on Windows 7 Enterprise x64, and I am able to get your attached script to run from a command prompt with no warnings and no errors, i.e., everything works as one would expect from reading documentation.&amp;nbsp; If I try to run the script from within an IDE, e.g., IDLE or PyCharm, then I get the warning about echoed passwords and they are echoed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Nov 2014 15:51:00 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2014-11-04T15:51:00Z</dc:date>
    <item>
      <title>Using getpass in python console widget echos password in Windows (Python 2.7 or earlier)</title>
      <link>https://community.esri.com/t5/python-questions/using-getpass-in-python-console-widget-echos/m-p/260170#M20020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When running the sample at &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Example_Derive_map_service_statistics_from_the_ArcGIS_Server_logs/0154000005vw000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/Example_Derive_map_service_statistics_from_the_ArcGIS_Server_logs/0154000005vw000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; , does anyone have this issue?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Using getpass in python console widget echos password in Windows (Python 2.7 or earlier)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;+++++++++++++++&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;What steps will reproduce the problem?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1.Open a python interpreter in the console&lt;/P&gt;&lt;P&gt;2.type the following:&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; import getpass&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; notMyPassword = getpass.getpass("type your password: ")&lt;/P&gt;&lt;P&gt;password&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the expected output? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It shows the prompt "don't type your password: " but the password characters are not echoed to the console window&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What do you see instead?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;getpass displays a warning that it couldn't control echo on the terminal, and that password input may be echoed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 02 Nov 2014 07:51:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-getpass-in-python-console-widget-echos/m-p/260170#M20020</guid>
      <dc:creator>larryzhang</dc:creator>
      <dc:date>2014-11-02T07:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using getpass in python console widget echos password in Windows (Python 2.7 or earlier)</title>
      <link>https://community.esri.com/t5/python-questions/using-getpass-in-python-console-widget-echos/m-p/260171#M20021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The &lt;A href="https://docs.python.org/2/library/getpass.html"&gt;getpass &lt;/A&gt;documentation states:&lt;TT class="descclassname" style="padding: 0px 1px; font-size: 0.95em;"&gt;&lt;/TT&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';"&gt;getpass.&lt;/SPAN&gt;&lt;STRONG style="color: black; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';"&gt;getpass&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;[&lt;/SPAN&gt;&lt;EM style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;prompt&lt;/EM&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;[&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;, &lt;EM&gt;stream&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;]]&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; text-align: justify; margin-bottom: auto; margin-left: 0.5in;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;Prompt the user for a password without echoing. The user is prompted using the string &lt;EM&gt;prompt&lt;/EM&gt;, which defaults to&lt;/SPAN&gt;&lt;SPAN style="background: #ecf0f3; color: black; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';"&gt;'Password: '&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;. On Unix, the prompt is written to the file-like object &lt;EM&gt;stream&lt;/EM&gt;. &lt;EM&gt;stream&lt;/EM&gt; defaults to the controlling terminal (/dev/tty) or if that is unavailable to &lt;/SPAN&gt;&lt;SPAN style="background: #ecf0f3; color: black; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';"&gt;sys.stderr&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt; (this argument is ignored on Windows).&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="background: white; text-align: justify; margin-bottom: auto; margin-left: 0.5in;"&gt;&lt;/P&gt;
&lt;P style="background: white; text-align: justify; margin-bottom: auto; margin-left: 0.5in;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;If echo free input is unavailable getpass() falls back to printing&lt;BR /&gt;a warning message to &lt;EM&gt;stream&lt;/EM&gt; and reading from &lt;/SPAN&gt;&lt;SPAN style="background: #ecf0f3; color: black; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';"&gt;sys.stdin&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;and issuing a &lt;/SPAN&gt;&lt;STRONG style="color: #355f7c; font-family: 'Courier New'; mso-fareast-font-family: 'Times New Roman';"&gt;GetPassWarning&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman';"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="text-align: justify; color: #000000; text-indent: 0px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From what you describe, it seems your code is working as expected.&amp;nbsp; Are you on Windows or Linux? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 19:42:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-getpass-in-python-console-widget-echos/m-p/260171#M20021</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-11-03T19:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using getpass in python console widget echos password in Windows (Python 2.7 or earlier)</title>
      <link>https://community.esri.com/t5/python-questions/using-getpass-in-python-console-widget-echos/m-p/260172#M20022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;JB,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you reproduce this issue?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;As expected, using getpass in python echos password in Windows (Python 2.7 or earlier), that is, a &lt;A _jive_internal="true" class="internal reference" href="https://community.esri.com/message/exceptions.html#exceptions.UserWarning" title="exceptions.UserWarning"&gt;&lt;TT class="xref py-exc py docutils literal"&gt;&lt;SPAN class="pre"&gt;UserWarning&lt;/SPAN&gt;&lt;/TT&gt;&lt;/A&gt; subclass issued.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="196" style="border: 1px solid #c6c6c6; width: 570px; height: 157px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;10.1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: left; background-color: #f2f2f2; color: #505050; padding: 6px;" valign="middle"&gt;&lt;STRONG&gt;10.2.2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 6px;"&gt;&lt;P&gt;Warning (from warnings module):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.1\lib\getpass.py", line 92&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return fallback_getpass(prompt, stream)&lt;/P&gt;&lt;P&gt;GetPassWarning: Can not control echo on the terminal.&lt;/P&gt;&lt;P&gt;Warning: Password input may be echoed.&lt;/P&gt;&lt;P&gt;Enter password:&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 6px;"&gt;&lt;P&gt;Warning: Password input may be echoed&lt;/P&gt;&lt;P&gt;Enter password:&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;The same issu is applied to all scrips, when using getpass, for example, start a service by starting the geometry service at &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Scripting_languages_and_the_ArcGIS_REST_API/0154000005w0000000/" title="http://resources.arcgis.com/en/help/main/10.2/index.html#/Scripting_languages_and_the_ArcGIS_REST_API/0154000005w0000000/"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Didn't try 10.3 Prerelease (I guess, the issue exist because 10.3 uses still Python 2.7). I tested with 3.4, which is fine in Python 3.4 (that ArcGIS Pro uses).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keep in mind, if we directly run the code like username=getpass.getuser() OR username = raw_input("Enter user name: "), it would be fine. Pls check at &lt;A _jive_internal="true" href="https://community.esri.com/message/284618#284618" title="https://community.esri.com/message/284618#284618"&gt;https://community.esri.com/message/284618#284618&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, if input without using 'getpass', the example works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 04:00:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-getpass-in-python-console-widget-echos/m-p/260172#M20022</guid>
      <dc:creator>larryzhang</dc:creator>
      <dc:date>2014-11-04T04:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Using getpass in python console widget echos password in Windows (Python 2.7 or earlier)</title>
      <link>https://community.esri.com/t5/python-questions/using-getpass-in-python-console-widget-echos/m-p/260173#M20023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am running ArcGIS 10.2.2 with Python 2.7.5 on Windows 7 Enterprise x64, and I am able to get your attached script to run from a command prompt with no warnings and no errors, i.e., everything works as one would expect from reading documentation.&amp;nbsp; If I try to run the script from within an IDE, e.g., IDLE or PyCharm, then I get the warning about echoed passwords and they are echoed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2014 15:51:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/using-getpass-in-python-console-widget-echos/m-p/260173#M20023</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2014-11-04T15:51:00Z</dc:date>
    </item>
  </channel>
</rss>

