[issue34479] ArgumentParser subparser error display at the wrong level

2018-09-20 Thread paul j3
Change by paul j3 : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34479> ___ ___ Python-bugs-list

[issue34744] New %(flag)s format specifier for argparse.add_argument help string

2018-09-21 Thread paul j3
paul j3 added the comment: In your proposed change: params = dict(vars(action), prog=self._prog) + if action.option_strings: + params['flag'] = action.option_strings[0] 'params', as I noted earlier already includes the 'dest&#x

[issue16360] argparse: comma in metavar causes assertion failure when formatting long usage message

2018-09-22 Thread paul j3
paul j3 added the comment: I'm closing this since the https://bugs.python.org/issue11874 fix also handles this issue. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.pyth

[issue34479] ArgumentParser subparser error display at the wrong level

2018-09-22 Thread paul j3
Change by paul j3 : -- resolution: -> not a bug ___ Python tracker <https://bugs.python.org/issue34479> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue34458] No way to alternate options

2018-09-22 Thread paul j3
Change by paul j3 : -- resolution: -> not a bug ___ Python tracker <https://bugs.python.org/issue34458> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue34744] New %(flag)s format specifier for argparse.add_argument help string

2018-09-22 Thread paul j3
Change by paul j3 : -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue34188] Allow dict choices to "transform" values in argpagse

2018-09-22 Thread paul j3
Change by paul j3 : -- resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34188> ___

[issue34046] subparsers -> add_parser doesn't support hyphen char '-'

2018-09-22 Thread paul j3
Change by paul j3 : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34046> ___

[issue26952] argparse help formatter crashes

2018-09-22 Thread paul j3
paul j3 added the comment: If I add an argument to the mutexGroup as suggested by xiang In [7]: mutexGroup.add_argument('--foo', action='store_true') Out[7]: _StoreTrueAction(option_strings=['--foo'], dest='foo', nargs=0, const=True, default=False, typ

[issue33415] When add_mutually_exclusive_group is built without argument, the help breaks with "IndexError: list index out of range"

2018-09-22 Thread paul j3
paul j3 added the comment: This is duplicate of https://bugs.python.org/issue26952 - argparse help formatter crashes The same issue - a mutually exclusive group without arguments. It also deals with issue of nesting groups. -- resolution: -> duplicate stage: -> resolved

[issue26952] argparse help formatter crashes

2018-09-22 Thread paul j3
paul j3 added the comment: https://bugs.python.org/issue29553 deals with a similar problem, the usage display when one mutually exclusive group is embedded in another mutually exclusive group. In that case, usage is displayed, but with some missing brackets. As here there are two issues

[issue34694] Dismiss To Avoid Slave/Master wording cause it easier for non English spoken programmers

2018-09-26 Thread Paul Moore
Change by Paul Moore : -- nosy: -paul.moore ___ Python tracker <https://bugs.python.org/issue34694> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue31405] shutil.which doesn't find files without PATHEXT extension on Windows

2018-09-26 Thread Paul Moore
Paul Moore added the comment: I don't think this is expected behaviour. It's not documented what should happen in this case but the behaviour suggested by the OP (to search for the path as given, followed by [path+e for e in os.environ['PATHEXT'].split(os.pathsep)] se

[issue31405] shutil.which doesn't find files without PATHEXT extension on Windows

2018-09-26 Thread Paul Moore
Paul Moore added the comment: On further reflection, I'm less sure that the proposed behaviour is the best option, but I do think this warrants further consideration. -- ___ Python tracker <https://bugs.python.org/is

[issue34744] New %(flag)s format specifier for argparse.add_argument help string

2018-09-26 Thread paul j3
paul j3 added the comment: The preferred way of adding new features to the Formatter is to subclass it, and modify one or more methods. That's what the existing alternative formatters do. A user can easily create such a subclass, and use it with their own parser, without having to m

[issue34803] argparse int type does not accept scientific notation

2018-09-26 Thread paul j3
paul j3 added the comment: The `type` parameter is normally a function (or more generally a callable). When given a string it should convert it as needed, or raise an error. In your example that function is the stock, 'int()'. Test `int('123')`, `int('1e3')

[issue34803] argparse int type does not accept scientific notation

2018-09-27 Thread paul j3
Change by paul j3 : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34803> ___

[issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class

2018-09-27 Thread paul j3
paul j3 added the comment: An alternative to customizing a HelpFormatter is to write your own utility `add_argument` function, e.g. def my_add_argument(parser, *args, add_default=True, **kwargs): if add_default: help = kwargs.get('help','') help += &#x

[issue34827] Make argparse.NameSpace iterable

2018-09-28 Thread paul j3
paul j3 added the comment: As documented in https://docs.python.org/3/library/argparse.html#the-namespace-object you can create your own 'namespace' class, that does everything you want and more. argparse makes very few assumptions about the object - using getattr, setattr, a

[issue32756] argparse: parse_known_args: raising exception on unknown arg following known one

2018-09-29 Thread paul j3
Change by paul j3 : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue32756> ___

[issue32833] argparse doesn't recognise two option aliases as equal

2018-09-29 Thread paul j3
paul j3 added the comment: I'm going to close this issue. The current behavior is a logical consequence of how option_strings and abbreviations are handled. Handling this particular case differently would be require adding a special test, as opposed to a minor tweak to the current

[issue32552] Improve text for file arguments in argparse.ArgumentDefaultsHelpFormatter class

2018-09-29 Thread paul j3
paul j3 added the comment: https://bugs.python.org/issue28742 argparse.ArgumentDefaultsHelpFormatter sometimes provides inaccurate documentation of defaults, so they should be overrideable is asking for something similar - the ability to override the automatic `%(default)s` in certain cases

[issue34744] New %(flag)s format specifier for argparse.add_argument help string

2018-09-29 Thread paul j3
paul j3 added the comment: https://bugs.python.org/issue13280, argparse should use the new Formatter class Raymond Hettinger argued against making such a switch. However there may be some value in allowing its use in parallel with the '%' style of formatting. That is, if the &#x

[issue13280] argparse should use the new Formatter class

2018-09-29 Thread paul j3
paul j3 added the comment: Thinking about https://bugs.python.org/issue34744, I realized that the new style formatting could provide some added flexibility to the help lines. I think new style formatting could be added in parallel with the existing style, as an alternative, not as a

[issue34911] Allow Cookies for Secure WebSockets

2018-10-05 Thread Paul Bailey
New submission from Paul Bailey : http.cookiejar.DefaultCookiePolicy should support the secure websocket protocol wss. WebSockets start off as HTTP requests and then get upgraded but have a different protocol of `wss` instead of `https`. This means secure cookies are not passed through by

[issue30588] Missing documentation for codecs.escape_decode

2018-10-06 Thread Paul Hoffman
Paul Hoffman added the comment: Bumping this thread a bit. It appears that this "internal" function is being talked about out in the real world. I came across it in a recent blog post, saw that it wasn't in the official documentation, and went looking here. I propose that i

[issue34903] strptime %d handling of single digit day of month

2018-10-08 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker <https://bugs.python.org/issue34903> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35005] argparse should accept json and yaml argument types

2018-10-16 Thread paul j3
paul j3 added the comment: The results of reading one of these @-prefix files are just spliced into the `argv` list before it is parsed. This is done early in the parsing method, in the _read_args_from_files method. The documentation illustrates how this file reading can be modified to

[issue35005] argparse should accept json and yaml argument types

2018-10-17 Thread paul j3
paul j3 added the comment: If I define a 'type' function like: def readdata(astr): if astr.startswith('@'): with open(astr[1:], 'r') as f: d = json.load(f) return d else: return astr I can use it to load a json fi

[issue30220] Why are custom messages for ValueError, TypeError suppressed in argparse?

2018-10-18 Thread paul j3
paul j3 added the comment: I'm going to close this. Python makes it easy to test for Exception class. Testing exception messages is messy, especially if the test wants to compare the message against 'generic message'. I don't see anything generic about the messages pr

[issue20039] Missing documentation for argparse.ArgumentTypeError

2018-10-18 Thread paul j3
paul j3 added the comment: A related closed request: https://bugs.python.org/issue30220 that wants to test ValueError for non-generic message, instead of using ArgumentTypeError. -- ___ Python tracker <https://bugs.python.org/issue20

[issue35005] argparse should accept json and yaml argument types

2018-10-18 Thread paul j3
paul j3 added the comment: Adding a new 'type' function or factor is certainly possible, and probably will be free of backward compatibility issues. But so far no other custom type has been added to argparse. https://bugs.python.org/issue23884 - rejects adding a DateTime cl

[issue35005] argparse should accept json and yaml argument types

2018-10-18 Thread paul j3
paul j3 added the comment: This kind of file read can be done just as easily after parsing. For example using the function in my previous post: In [127]: parser = argparse.ArgumentParser() In [128]: parser.add_argument('-d','--data'); In [129]: args = parser.parse_a

[issue35004] Odd behavior when using datetime.timedelta under cProfile

2018-10-22 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker <https://bugs.python.org/issue35004> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35049] argparse.ArgumentParser fails on arguments with leading dash and comma

2018-10-24 Thread paul j3
paul j3 added the comment: I think it's the same issue. A dash argument that is not clearly a number is interpreted as an optional's flag. With few exceptions, the parser does not examine the contents of the string It tests the initial character, it tests for space, it tests f

[issue35049] argparse.ArgumentParser fails on arguments with leading dash and comma

2018-10-24 Thread paul j3
Change by paul j3 : -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35049> ___

[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Paul Crowley
New submission from Paul Crowley : random.sample currently uses either a Fisher-Yates shuffle, or rejection sampling, to achieve sampling without replacement. I propose using reservoir sampling or "cardchoose"; these are similar performance or sometimes faster, and don't n

[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Paul Crowley
Change by Paul Crowley : -- keywords: +patch pull_requests: +9510 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35094> ___ ___ Py

[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Paul Crowley
Paul Crowley added the comment: I would be very grateful for your help finding those dicussions! I've tried this search: https://www.google.com/search?q=python+%22Reservoir+sampling%22+rhettinger and found this discussion: https://mail.python.org/pipermail/python-ideas/2016-April/0

[issue35094] Improved algorithms for random.sample

2018-10-28 Thread Paul Crowley
Paul Crowley added the comment: Thank you for a very comprehensive and helpful answer! Yep, reservoir sampling makes n calls not k calls, and so should only be used when k is a large fraction of n; in my patch it's k/n >= 1/2. Because modern CPRNGs are so fast, I had been assum

[issue19376] document that strptime() does not support the Feb 29 if the format does not contain the year

2018-10-30 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker <https://bugs.python.org/issue19376> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19376] document that strptime() does not support the Feb 29 if the format does not contain the year

2018-10-30 Thread Paul Ganssle
Paul Ganssle added the comment: @Victor: You mean a PR to fix the *issue* or a PR to add this to the docs? The current behavior is pretty counter-intuitive, particularly because it also fails because of the (relatively) little-known fact that 1900 happens to not be a leap year because it is

[issue35066] Inconsistency between dangling '%' handling in time.strftime() and datetime.strftime()

2018-10-30 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker <https://bugs.python.org/issue35066> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35145] sqlite3: "select *" should autoconvert datetime fields

2018-11-02 Thread Paul Ganssle
Paul Ganssle added the comment: According to the sqlite documentation, there's no fundamental datetime type in sqlite: https://www.sqlite.org/datatype3.html#date_and_time_datatype SQLite does not have a storage class set aside for storing dates and/or times. Instead, the bui

[issue35145] sqlite3: "select *" should optionally sniff and autoconvert TEXT datetime fields

2018-11-05 Thread Paul Ganssle
Paul Ganssle added the comment: With regards to automatically deducing column types, I am -1 on that. It has way too many dangerous edge cases, and I know of countless bugs in software that are the direct result of stringly-typed data being coerced into a specific data type based on its

[issue35171] test_TimeRE_recreation_timezone failure on systems with non-default posixrules

2018-11-05 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker <https://bugs.python.org/issue35171> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35186] distutils.command.upload uses deprecated platform.dist with bdist_rpm

2018-11-07 Thread Paul Ganssle
New submission from Paul Ganssle : It seems that in issue #1322, `platform.dist` was deprecated, and is slated for removal in Python 3.8, but it is currently used in distutils.command.upload.upload_file: https://github.com/python/cpython/blob/6843ffe4533e9f2cde036296fd932fef6f059687/Lib

[issue35186] distutils.command.upload uses deprecated platform.dist with bdist_rpm

2018-11-08 Thread Paul Ganssle
Change by Paul Ganssle : -- keywords: +patch pull_requests: +9694 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35186> ___ ___ Py

[issue35081] Move internal headers to Include/internal/

2018-11-08 Thread Paul Ganssle
Change by Paul Ganssle : -- pull_requests: +9696 ___ Python tracker <https://bugs.python.org/issue35081> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35190] collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2018-11-08 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker <https://bugs.python.org/issue35190> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14191] argparse doesn't allow optionals within positionals

2013-05-29 Thread paul j3
paul j3 added the comment: This is a refinement of the patch with Message188609. In parse_known_intermixed_args, the temporary capture of formatted usage has been put in a try/finally structure. Positionals are now 'deactivated' with action.nargs = SUPPRESS action.default

[issue13238] Add shell command helpers to subprocess module

2013-06-13 Thread Paul Moore
Paul Moore added the comment: There's also https://pypi.python.org/pypi/sarge One other thing I *often* want to do when scripting commands is to capture output, but provide some form of "progress" reporting (something like a dot per line of output, usually). That's ann

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2013-06-26 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker <http://bugs.python.org/issue9625> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2013-06-26 Thread paul j3
paul j3 added the comment: I've added 2 more tests, one with default='c', which worked before. one with default=['a','b'], which only works with this change. http://bugs.python.org/issue16878 is useful reference, since it documents the differences between

[issue16468] argparse only supports iterable choices

2013-06-27 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker <http://bugs.python.org/issue16468> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue16418] argparse with many choices can generate absurdly long usage message

2013-06-29 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker <http://bugs.python.org/issue16418> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue16468] argparse only supports iterable choices

2013-06-30 Thread paul j3
paul j3 added the comment: chris.jerdonek wrote: "Also, to answer a previous question, the three places in which the choices string is used are: in the usage string (separator=','), in the help string when expanding "%(choices)s" (separator=', '), and in

[issue9938] Documentation for argparse interactive use

2013-07-01 Thread paul j3
paul j3 added the comment: The exit and error methods are mentioned in the 3.4 documentation, but there are no examples of modifying them. 16.4.5.9. Exiting methods ArgumentParser.exit(status=0, message=None) ArgumentParser.error(message) test_argparse.py has a subclass that

[issue18349] argparse usage should preserve () in metavars such as range(20)

2013-07-02 Thread paul j3
New submission from paul j3: As discussed in issue 16468, a metavar may be used to provide an alternative representation of a choices option. However if a metvar like 'range(20)' is used, usage formatter strips off the '()'. >>> parser.add_argument('foo&

[issue18349] argparse usage should preserve () in metavars such as range(20)

2013-07-02 Thread paul j3
Changes by paul j3 : -- components: +Library (Lib) type: -> behavior versions: +Python 3.4 ___ Python tracker <http://bugs.python.org/issue18349> ___ ___ Py

[issue16933] argparse: remove magic from examples

2013-07-03 Thread paul j3
paul j3 added the comment: There still is one "choices='XYZ'" example (16.4.5.1. Sub-commands) but the focus isn't on choices. -- nosy: +paul.j3 ___ Python tracker <http:

[issue16977] argparse: mismatch between choices parsing and usage/error message

2013-07-03 Thread paul j3
paul j3 added the comment: test_argparse.py has some "choices='abc'" cases. In those should "parser.parse_args(['--foo','bc'])" be considered a success or failure? The underlying issue here is that while string iteration behaves l

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2013-07-03 Thread paul j3
paul j3 added the comment: Change "choices='abc'" to "choices=['a', 'b', 'c']", as discussed in issue 16977 (use of string choices is a bad example) -- Added file: http://bugs.python.org/file30762/issue9625_2.patch _

[issue16468] argparse only supports iterable choices

2013-07-03 Thread paul j3
paul j3 added the comment: I'd suggest not worrying about the default metavar in the _expand_help() method. The formatted choice string created in that method is only used if the help line includes a '%(choices)s' string. The programmer can easily omit that if he isn&#

[issue16977] argparse: mismatch between choices parsing and usage/error message

2013-07-04 Thread paul j3
paul j3 added the comment: Changing _check_value from: def _check_value(self, action, value): # converted value must be one of the choices (if specified) if action.choices is not None and value not in action.choices: ... to def _check_value(self, action

[issue16468] argparse only supports iterable choices

2013-07-08 Thread paul j3
paul j3 added the comment: This patch generally deals with the choices option, and specifically the problems with formatting long lists, or objects that have __contains__ but not __iter__. But it also incorporates issues 9849 (better add_argument testing) and 9625 (choices with *). It may be

[issue16977] argparse: mismatch between choices parsing and usage/error message

2013-07-08 Thread paul j3
paul j3 added the comment: I just posted a patch to http://bugs.python.org/issue16468 that deals with this 'bc' in 'abc' issue. -- ___ Python tracker <http://bug

[issue18349] argparse usage should preserve () in metavars such as range(20)

2013-07-08 Thread paul j3
paul j3 added the comment: I just posted a patch to http://bugs.python.org/issue16468 that uses (and tests) this fix. -- ___ Python tracker <http://bugs.python.org/issue18

[issue9625] argparse: Problem with defaults for variable nargs when using choices

2013-07-08 Thread paul j3
paul j3 added the comment: The patch I just posted to http://bugs.python.org/issue16468 uses this fix. -- ___ Python tracker <http://bugs.python.org/issue9

[issue16418] argparse with many choices can generate absurdly long usage message

2013-07-08 Thread paul j3
paul j3 added the comment: In the patch I just posted to http://bugs.python.org/issue16468 I address this long list issue in several ways: In the Usage line, the metavar gives the user an alternative In the expanded help line the user can just omit the '%(choices)s' In _check_

[issue9849] Argparse needs better error handling for nargs

2013-07-08 Thread paul j3
paul j3 added the comment: I included this patch (with minor changes) in a patch that I just posted to http://bugs.python.org/issue16468. That issue deals with the argument choices option, which can be tested along with nargs and metavars

[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2013-07-09 Thread paul j3
paul j3 added the comment: This approach of simply adding the existing actions to the group's _group_actions works fine, at least when it comes catching the error. It may be difficult to get a useful usage line. In usage, arguments appear in the order in which they were created, opti

[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2013-07-10 Thread paul j3
paul j3 added the comment: One usage option is to make a subclass of HelpFormatter (the accepted way of customizing a formatter), and write a function that formats each group independently. For the example case, the resulting format might be: usage: PROG [-h] [-b] [-a | -c] [-a | -d] -h

[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2013-07-12 Thread paul j3
paul j3 added the comment: While playing with some examples, I found that exclusive group formatting has another failure case. If the usage line is long enough to wrap, optionals and positionals are formatted separately, with positionals appearing on a separate line(s). That means that if a

[issue11874] argparse assertion failure with brackets in metavars

2013-07-13 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker <http://bugs.python.org/issue11874> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue11874] argparse assertion failure with brackets in metavars

2013-07-14 Thread paul j3
paul j3 added the comment: If the arg_parts are passed through the same cleanup as the 'text' (and empty strings removed), then text = ' '.join(arg_parts) In that case there would be no need to return both (text, arg_parts). Parenthesis in the metavar could als

[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2013-07-14 Thread paul j3
paul j3 added the comment: This patch adds a MultiGroupHelpFormatter that formats groups even if they share actions or the actions are not in the same order as in the parse._actions list. It sorts the groups so positional actions, if any appear in the correct order. A long test case

[issue11874] argparse assertion failure with brackets in metavars

2013-07-14 Thread paul j3
paul j3 added the comment: I just filed a patch with http://bugs.python.org/issue10984 (argparse add_mutually_exclusive_group should accept existing arguments to register conflicts) that includes the latest patch from this issue. I tweaked it so _format_actions_usage only returns arg_parts

[issue18349] argparse usage should preserve () in metavars such as range(20)

2013-07-15 Thread paul j3
paul j3 added the comment: This issue should also preserve a metavar like: '(one)two', i.e. '(' at the start. In http://bugs.python.org/issue10984 these _re replacements are applied to individual action strings as well as the whole usage line. So if () are to be re

[issue10984] argparse add_mutually_exclusive_group should accept existing arguments to register conflicts

2013-07-16 Thread paul j3
paul j3 added the comment: This patch produces the same usage as before, but I have rewritten _format_actions_usage() for both HelpFormatter and MultiGroupFormater. The original HelpFormatter._format_actions_usage() formats the actions, splices in group markings, cleans up the text, if needed

[issue11874] argparse assertion failure with brackets in metavars

2013-07-16 Thread paul j3
paul j3 added the comment: Here's a patch that takes a different approach - rewrite _format_actions_usage() so it formats groups (and unattached actions) directly. It uses the same logic to determine when to format a group, but then it calls _format_group_usage() to format the

[issue18349] argparse usage should preserve () in metavars such as range(20)

2013-07-16 Thread paul j3
paul j3 added the comment: I just submitted at patch to http://bugs.python.org/issue11874 that takes care of this issue as well. I rewrote _format_actions_usage() so it formats the parts directly, so there is no need cleanup or parse the full text string

[issue16468] argparse only supports iterable choices

2013-07-16 Thread paul j3
paul j3 added the comment: I just submitted a patch to http://bugs.python.org/issue11874 which rewrites _format_actions_usage(). It now formats the groups and actions directly, keeping a list of these parts. It no longer has to cleanup or split a usage line into parts. So it is not

[issue17890] argparse: mutually exclusive groups full of suppressed args can cause AssertionErrors

2013-07-16 Thread paul j3
paul j3 added the comment: I just submitted a patch to http://bugs.python.org/issue11874 that substantially rewrites _format_actions_usage(). It generates the group and action parts separately, and does not do the kind of cleanup that produces this issue

[issue18467] argparse - problematic 'default' behavior

2013-07-16 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker <http://bugs.python.org/issue18467> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue18467] argparse - problematic 'default' behavior

2013-07-16 Thread paul j3
paul j3 added the comment: I think this example illustrates your issue: class FooAction(argparse.Action): def __call__(self, parser, namespace, values, option_string = None): if values=='Q': setattr(namespace,

[issue18479] Improvements to Powershell activate script for venv

2013-07-17 Thread Paul Moore
New submission from Paul Moore: Some small improvements to the powershell "Activate" script for venvs: 1. Can be run as a command, rather than needing to be dot sourced. This matches the behaviour of bat files, and of virtualenv's "activate" script, and avoids a

[issue18491] Add "exe wrapper" functionality to Windows launcher

2013-07-18 Thread Paul Moore
New submission from Paul Moore: Adds "exe wrapper" functionality to the Windows launcher. This is a preliminary patch, for comments - the code is there and works, but I need to add documentation (and maybe tests - are there any existing tests for the launcher?) Also to be consider

[issue18491] Add "exe wrapper" functionality to Windows launcher

2013-07-18 Thread Paul Moore
Changes by Paul Moore : -- keywords: +patch Added file: http://bugs.python.org/file30966/launcher_wrapper.patch ___ Python tracker <http://bugs.python.org/issue18

[issue18491] Add "exe wrapper" functionality to Windows launcher

2013-07-18 Thread Paul Moore
Changes by Paul Moore : -- nosy: +tim.golden ___ Python tracker <http://bugs.python.org/issue18491> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18491] Add "exe wrapper" functionality to Windows launcher

2013-07-18 Thread Paul Moore
Paul Moore added the comment: Correct about .pyw files - I had forgotten those, I will update the patch. The idea of "support code" was to (somewhat) alleviate Mark's question about "what is this for", I was wondering if it was worth adding a module to the stdlib whic

[issue18491] Add "exe wrapper" functionality to Windows launcher

2013-07-19 Thread Paul Moore
Paul Moore added the comment: I've no problem with that suggestion. The patch is clean enough that ifdef-ing it out won't be hard. Revised patch incoming :-) It's needed for the pyw support in any case. -- ___ Python

[issue18467] argparse - problematic 'default' behavior

2013-07-19 Thread paul j3
paul j3 added the comment: Since parse_args takes an optional Namespace argument, you can set the its initial value to almost anything. For example, with the functions defined previously: parser = argparse.ArgumentParser() parser.add_argument('-a','--algorithm&#x

[issue18491] Add "exe wrapper" functionality to Windows launcher

2013-07-21 Thread Paul Moore
Paul Moore added the comment: Updated patch, as per discussion. -- Added file: http://bugs.python.org/file30994/launcher_wrapper.patch ___ Python tracker <http://bugs.python.org/issue18

[issue18491] Add "exe wrapper" functionality to Windows launcher

2013-07-21 Thread Paul Moore
Changes by Paul Moore : Removed file: http://bugs.python.org/file30966/launcher_wrapper.patch ___ Python tracker <http://bugs.python.org/issue18491> ___ ___ Python-bug

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2013-07-26 Thread paul j3
Changes by paul j3 : -- nosy: +paul.j3 ___ Python tracker <http://bugs.python.org/issue14074> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue16360] argparse: comma in metavar causes assertion failure when formatting long usage message

2013-07-26 Thread paul j3
paul j3 added the comment: My rewrite of _format_actions_usage in http://bugs.python.org/issue11874 should take care of this issue. It keeps the groups and actions separate until the final formatting step, bypassing the regular expression parsing. -- nosy: +paul.j3

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2013-07-26 Thread paul j3
paul j3 added the comment: This patch fixes the problem by joining the metavar terms with '|'. So the help for the test case (adapted from an existing tuple test) looks like: usage: PROG [-h] W1 [W2 ...] [X1 [X2 ...]] Y1 Y2 Y3 [Z1] positional arguments: W1|W2 w

[issue18569] Set PATHEXT in the Windows installer

2013-07-27 Thread Paul Moore
New submission from Paul Moore: Make the Windows Python installer set PATHEXT when "Register Python extensions" is set. This allows users to run a scripy by typing the name of the .py file at the command line without the .py extension. The patch needs review - I have not been abl

[issue9253] argparse: optional subparsers

2013-07-30 Thread paul j3
paul j3 added the comment: "msg113512 - (view) Author: Steven Bethard (bethard) Seems like there's minimally the bug that argparse should currently throw an error if you add an argument after subparsers (since that argument will never be parsed under the current semantics).&qu

<    13   14   15   16   17   18   19   20   21   22   >