Skip to content

Instantly share code, notes, and snippets.

View pde's full-sized avatar

Peter Eckersley pde

View GitHub Profile

Keybase proof

I hereby claim:

  • I am pde on github.
  • I am pde (https://keybase.io/pde) on keybase.
  • I have a public key whose fingerprint is A56B A27D 94B8 96BE EB64 0129 494F 21B9 D67C 4D21

To claim this, I am signing this object:

@pde
pde / argparse_default_override.diff
Created December 6, 2016 08:43
allow overriding of argparse.ArgumentDefaultsHelpFormatter default values
diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst
index c6b2bf6..15f2fe8 100644
--- a/Doc/library/argparse.rst
+++ b/Doc/library/argparse.rst
@@ -429,13 +429,15 @@ should not be line-wrapped::
including argument descriptions.
:class:`ArgumentDefaultsHelpFormatter` automatically adds information about
-default values to each of the argument help messages::
+default values to each of the argument help messages, unless they already
@pde
pde / argparse_help_default.diff
Last active November 19, 2016 01:17
Patch python3.7's argparse.py to support overriding the strings that are shown as default values for flags
diff --git a/Lib/argparse.py b/Lib/argparse.py
index 209b4e9..254b803 100644
--- a/Lib/argparse.py
+++ b/Lib/argparse.py
@@ -665,11 +665,11 @@ class ArgumentDefaultsHelpFormatter(HelpFormatter):
def _get_help_string(self, action):
help = action.help
- if '%(default)' not in action.help:
+ if '%(default)' not in help and '%(help_default)' not in help:
@pde
pde / certbot-auto-output.txt
Last active November 3, 2016 00:30
Full output from Certbot bug #3732
sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libtrio2
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
python-pip-whl
The following packages will be upgraded: