This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author valhallasw
Recipients valhallasw
Date 2011-02-17.21:09:12
SpamBayes Score 0.00041429745
Marked as misclassified No
Message-id <1297976953.26.0.247983730565.issue11236@psf.upfronthosting.co.za>
In-reply-to
Content
To allow people to cancel at the password prompt, we added a manual post-check. Although this check runs after return is pressed, it's better than nothing.

Index: branches/rewrite/pywikibot/userinterfaces/terminal_interface.py
===================================================================
--- branches/rewrite/pywikibot/userinterfaces/terminal_interface.py	(revision 8977)
+++ branches/rewrite/pywikibot/userinterfaces/terminal_interface.py	(revision 8978)
@@ -175,6 +175,11 @@
             if password:
                 import getpass
                 text = getpass.getpass('')
+                # See PYWP-13 / http://bugs.python.org/issue11236
+                # getpass does not always raise an KeyboardInterrupt when ^C
+                # is pressed.
+                if '\x03' in text:
+                    raise KeyboardInterrupt()
             else:
                 text = raw_input()
         finally:

http://www.mediawiki.org/wiki/Special:Code/pywikipedia/8978
History
Date User Action Args
2011-02-17 21:09:13valhallaswsetrecipients: + valhallasw
2011-02-17 21:09:13valhallaswsetmessageid: <1297976953.26.0.247983730565.issue11236@psf.upfronthosting.co.za>
2011-02-17 21:09:12valhallaswlinkissue11236 messages
2011-02-17 21:09:12valhallaswcreate