Kyle Meyer
8edfc47bae
bpo-39546: argparse: Honor allow_abbrev=False for specified prefix_chars (GH-18337)
...
When `allow_abbrev` was first added, disabling the abbreviation of
long options broke the grouping of short flags ([bpo-26967](https://bugs.python.org/issue26967 )). As a fix,
b1e4d1b603 (contained in v3.8) ignores `allow_abbrev=False` for a
given argument string if the string does _not_ start with "--"
(i.e. it doesn't look like a long option).
This fix, however, doesn't take into account that long options can
start with alternative characters specified via `prefix_chars`,
introducing a regression: `allow_abbrev=False` has no effect on long
options that start with an alternative prefix character.
The most minimal fix would be to replace the "starts with --" check
with a "starts with two prefix_chars characters". But
`_get_option_tuples` already distinguishes between long and short
options, so let's instead piggyback off of that check by moving the
`allow_abbrev` condition into `_get_option_tuples`.
https://bugs.python.org/issue39546
2020-02-18 01:48:57 -08:00
..
2019-09-18 14:15:10 +02:00
2019-11-19 23:46:49 +00:00
2020-02-03 15:17:15 +01:00
2020-02-01 13:12:52 +02:00
2019-12-08 17:37:34 -08:00
2020-01-22 16:42:38 -08:00
2020-02-11 21:58:47 -05:00
2020-01-20 13:54:00 +09:00
2019-11-24 23:02:40 +00:00
2020-02-03 15:17:15 +01:00
2019-09-10 09:14:11 -07:00
2019-12-17 18:37:26 +01:00
2019-11-21 17:24:58 +00:00
2019-12-09 11:18:12 -08:00
2019-10-21 09:49:48 +03:00
2019-12-09 15:54:20 +01:00
2019-09-19 14:34:41 +01:00
2019-08-25 23:45:40 +10:00
2019-12-11 11:30:03 +01:00
2019-09-25 08:55:02 -07:00
2019-08-04 14:12:48 +03:00
2019-09-01 12:16:51 +03:00
2019-09-25 08:55:02 -07:00
2020-02-02 10:55:21 -08:00
2020-01-27 18:06:42 +01:00
2019-09-11 17:02:34 +01:00
2019-08-04 14:12:48 +03:00
2019-12-11 11:30:03 +01:00
2020-02-03 08:47:20 -08:00
2019-09-25 08:55:02 -07:00
2019-12-10 20:32:59 +01:00
2019-10-30 12:03:53 +02:00
2019-12-09 22:16:00 +00:00
2020-01-31 12:07:09 -08:00
2019-09-11 17:29:44 +02:00
2020-02-18 01:48:57 -08:00
2019-12-09 14:09:14 +01:00
2020-02-12 22:37:49 +02:00
2020-02-13 00:15:38 -08:00
2019-12-10 20:41:23 +01:00
2019-12-10 20:41:23 +01:00
2019-12-09 11:18:12 -08:00
2020-01-16 10:24:16 +01:00
2019-09-09 08:20:40 -07:00
2020-01-30 09:56:40 +01:00
2020-01-22 20:44:22 +01:00
2019-11-19 11:45:20 -08:00
2020-01-10 17:31:43 +01:00
2020-01-29 16:09:24 +09:00
2020-01-16 15:33:30 +01:00
2020-02-11 17:46:57 +01:00
2019-11-21 12:54:02 +01:00
2019-09-11 12:05:53 +01:00
2019-11-19 21:34:03 +00:00
2019-10-18 19:00:04 -07:00
2019-11-19 21:34:03 +00:00
2019-09-11 19:49:45 +01:00
2019-12-09 17:34:02 +01:00
2020-01-01 23:21:43 +01:00
2020-01-13 12:51:26 +00:00
2019-11-19 21:34:03 +00:00
2019-12-16 01:54:14 -08:00
2019-08-08 08:43:18 +03:00
2019-10-30 11:53:26 +00:00
2019-10-15 11:26:13 +02:00
2019-10-10 19:23:36 +03:00
2020-02-16 10:09:26 -08:00
2019-08-08 08:43:18 +03:00
2019-12-08 03:35:59 -08:00
2020-01-12 09:41:49 -08:00
2020-01-14 21:58:29 +10:00
2020-01-09 09:00:29 -08:00
2019-10-31 11:13:48 +02:00
2020-01-09 08:41:46 -05:00
2019-11-19 21:34:03 +00:00
2019-08-24 15:37:25 -07:00
2020-02-09 00:16:43 -08:00
2019-11-05 07:48:04 -08:00
2019-09-11 14:42:04 +01:00
2019-08-08 08:43:18 +03:00
2019-12-31 01:04:22 +00:00
2020-02-12 12:18:59 +02:00
2019-10-13 14:49:05 +03:00
2019-08-21 13:59:25 -05:00
2020-01-14 10:12:45 +00:00
2020-01-27 07:08:39 -05:00
2019-12-13 10:06:53 -08:00
2019-09-27 21:59:37 +02:00
2020-02-03 15:17:15 +01:00
2019-08-08 08:43:18 +03:00
2020-01-09 22:37:32 +05:30
2020-01-07 15:00:02 +01:00
2020-02-12 12:17:00 +02:00
2020-01-23 09:25:17 +00:00
2019-12-08 08:38:16 +01:00
2019-11-19 09:12:42 +01:00
2019-10-28 15:40:08 +01:00
2019-12-15 23:00:28 +01:00
2019-12-11 11:30:03 +01:00
2019-08-30 16:21:19 -04:00
2020-02-07 23:42:51 +01:00
2019-08-10 00:19:07 -07:00
2020-01-13 20:34:34 +01:00
2020-01-23 15:29:52 +00:00
2020-02-03 15:17:15 +01:00
2019-09-26 16:54:13 +02:00
2020-02-12 12:18:59 +02:00
2019-09-12 13:54:48 +01:00
2019-08-24 13:11:52 +03:00
2020-01-21 13:25:24 +02:00
2019-09-27 06:03:53 -07:00
2020-01-23 14:07:05 +00:00
2019-12-03 07:35:54 -08:00
2019-08-27 11:48:06 +09:00
2019-11-22 15:22:11 +01:00
2019-09-28 08:32:01 -04:00
2019-12-04 10:29:10 +01:00
2020-01-07 18:28:10 +01:00
2020-01-28 21:47:03 +09:00
2020-02-04 13:25:16 -08:00
2019-09-01 12:16:51 +03:00
2019-09-12 10:03:31 +01:00
2019-08-04 14:12:48 +03:00
2019-09-09 11:47:14 +03:00
2020-02-05 18:20:52 +01:00
2020-01-27 09:04:25 -08:00
2020-02-12 12:18:59 +02:00
2020-01-20 12:45:50 +09:00
2020-02-03 15:17:15 +01:00
2019-11-26 16:54:49 +09:00
2019-09-12 15:20:37 +01:00
2020-01-21 12:48:16 +01:00
2020-01-13 20:09:36 +05:30
2019-10-17 18:41:35 +08:00
2020-02-03 15:17:15 +01:00
2019-12-31 20:40:58 -06:00
2020-01-11 18:39:15 +01:00
2019-11-15 16:04:00 -08:00
2019-09-01 12:16:51 +03:00
2020-01-24 14:05:48 +01:00
2019-08-08 14:48:00 -07:00
2020-01-28 20:41:50 +11:00
2019-09-09 05:45:58 -05:00
2020-02-12 12:18:59 +02:00
2020-02-14 22:02:13 +00:00
2019-11-01 18:45:01 +02:00
2020-01-10 15:34:05 +01:00
2020-01-14 10:12:45 +00:00
2020-01-24 14:05:48 +01:00
2019-08-24 15:37:25 -07:00
2020-01-15 14:51:54 -08:00
2019-12-09 11:57:05 +01:00
2019-12-16 10:35:22 -08:00
2019-11-22 21:51:58 +09:00
2019-12-11 11:30:03 +01:00
2019-09-01 12:11:43 +03:00
2019-12-10 20:41:23 +01:00
2019-11-23 02:22:13 -08:00
2020-01-05 17:30:53 +00:00
2019-11-19 23:46:49 +00:00
2020-01-06 15:59:09 +00:00
2019-12-11 11:30:03 +01:00
2020-02-12 12:18:59 +02:00
2019-09-11 12:04:04 +01:00
2020-01-24 15:51:16 +01:00
2020-01-30 12:26:22 +02:00
2020-01-14 22:42:09 +01:00
2019-12-11 22:17:04 +01:00
2019-12-11 11:30:03 +01:00
2019-09-11 14:57:32 +01:00
2019-12-11 11:30:03 +01:00
2019-10-10 09:34:46 +02:00
2019-12-09 09:42:17 -08:00
2019-08-10 00:19:07 -07:00
2020-02-04 02:29:25 -08:00
2020-01-22 15:28:31 -08:00
2020-02-03 15:17:15 +01:00
2019-12-31 20:40:58 -06:00
2020-01-10 09:24:22 +00:00
2020-02-04 02:29:25 -08:00
2020-02-12 11:56:02 -08:00
2019-10-08 14:31:35 +03:00
2019-12-30 16:08:08 +00:00
2020-02-03 15:17:15 +01:00
2019-11-19 21:34:03 +00:00
2019-12-10 20:32:59 +01:00
2020-02-03 15:17:15 +01:00
2019-10-15 14:00:16 +02:00
2020-02-13 11:53:29 -08:00
2019-09-10 10:29:26 +01:00
2019-09-01 12:16:51 +03:00
2019-09-12 10:25:25 +01:00
2019-11-05 07:48:04 -08:00
2020-01-02 18:20:04 +00:00
2019-09-25 07:30:20 -07:00
2019-10-11 22:41:35 -07:00
2019-12-10 22:09:23 +01:00
2019-09-13 12:40:07 +01:00
2020-01-05 14:14:31 +02:00
2019-12-10 22:09:23 +01:00
2019-10-18 06:07:20 -07:00
2019-08-27 21:38:09 -07:00
2019-12-02 14:25:21 -08:00
2019-11-19 21:34:03 +00:00
2020-01-14 20:49:30 +00:00
2019-12-11 11:30:03 +01:00
2019-12-11 11:30:03 +01:00
2020-02-03 15:17:15 +01:00
2019-11-10 20:12:04 -08:00
2020-02-11 00:58:23 +01:00
2019-09-09 02:26:15 -07:00
2019-08-30 16:21:19 -04:00
2019-11-25 16:36:25 +01:00
2019-08-08 08:42:54 +03:00
2020-02-11 21:58:47 -05:00
2019-12-16 09:34:12 +10:00