Message128755
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 |
|
Date |
User |
Action |
Args |
2011-02-17 21:09:13 | valhallasw | set | recipients:
+ valhallasw |
2011-02-17 21:09:13 | valhallasw | set | messageid: <1297976953.26.0.247983730565.issue11236@psf.upfronthosting.co.za> |
2011-02-17 21:09:12 | valhallasw | link | issue11236 messages |
2011-02-17 21:09:12 | valhallasw | create | |
|