[issue13922] argparse handling multiple "--" in args improperly

2013-04-13 Thread paul j3
paul j3 added the comment: This patch removes only one '--', the one that put a '-' in the 'arg_strings_pattern'. It does this in 'consume_positionals' right before calling 'take_action'. As before it does not do this if nargs

[issue14191] argparse doesn't allow optionals within positionals

2013-04-16 Thread paul j3
paul j3 added the comment: This patch permits the mixing of optionals with positionals, with the caveat that a particular positional cannot be split up. If: parser = ArgumentParser() parser.add_argument('-f','--foo') parser.add_argument('cmd') par

[issue9849] Argparse needs better error handling for nargs

2013-04-16 Thread paul j3
paul j3 added the comment: It does shift the error from parse_args to add_argument, but the message 'ValueError: length of metavar tuple does not match nargs', indicates that it's a side effect of checking on the tuple form of `metavar`. http://bugs.python.org/issue9348 Ther

[issue16988] argparse: PARSER option for nargs not documented

2013-04-16 Thread paul j3
paul j3 added the comment: I've experimented with an argparse adaptation of profile.py: parser = argparse.ArgumentParser(usage=usage) parser.add_argument('-o', '--outfile', dest="outfile", help="Save stats to ", metavar="path&qu

[issue16878] argparse: positional args with nargs='*' defaults to []

2013-04-17 Thread paul j3
paul j3 added the comment: In this example: >>> p.add_argument('--foo', nargs='*', default=None) >>> p.parse_args([]) Namespace(foo=None) >>> p.parse_args(['--foo']) Namespace(foo=[]) 'p.parse_args([])'

[issue17050] argparse.REMAINDER doesn't work as first argument

2013-04-17 Thread paul j3
paul j3 added the comment: The problem isn't with REMAINDER, but with the distinction between optionals and arguments. If you change '--def' to 'def', the parse should work: >>> p = ArgumentParser(prog='test.py') >>> p.add_argument('re

[issue17050] argparse.REMAINDER doesn't work as first argument

2013-04-17 Thread paul j3
paul j3 added the comment: Here's a way of passing an optional-like argument to a subparser: parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(dest='cmd') sub1 = subparsers.add_parser('cmd') sub1.add_argument('foo',nargs=&#x

[issue13831] get method of multiprocessing.pool.Async should return full traceback

2013-04-17 Thread Paul Winkler
Changes by Paul Winkler : -- nosy: +slinkp ___ Python tracker <http://bugs.python.org/issue13831> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13831] get method of multiprocessing.pool.Async should return full traceback

2013-04-17 Thread Paul Winkler
Changes by Paul Winkler : -- versions: +Python 3.3 ___ Python tracker <http://bugs.python.org/issue13831> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14174] argparse.REMAINDER fails to parse remainder correctly

2013-04-17 Thread paul j3
paul j3 added the comment: An alternative to Jason's example: parser = argparse.ArgumentParser() parser.add_argument('app') parser.add_argument('--config') parser.add_argument('app_args', nargs=argparse.REMAINDER) args = parser.parse_args(['--confi

[issue14174] argparse.REMAINDER fails to parse remainder correctly

2013-04-17 Thread paul j3
paul j3 added the comment: By the way, parser.parse_args() uses parse_known_arg(). parse_known_args returns a Namespace and a list of unknown arguments. If that list is empty, parse_args returns the Namespace. If the list is not empty, parse_args raises an error. So parse_known_args does

[issue16142] ArgumentParser inconsistent with parse_known_args

2013-04-17 Thread paul j3
paul j3 added the comment: parser = argparse.ArgumentParser() parser.add_argument('-k','--known',action='store_true') print(parser.parse_known_args(['-k','-u'])) print(parser.parse_known_args(['-ku'])) print(parser.p

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2013-04-18 Thread paul j3
paul j3 added the comment: The 'subparsers' object has a _parser_class attribute that is normally set to the class of the parent parser. In the attached file I create a class CustomParser(argparse.ArgumentParser) that makes a parser instance which copies all of the att

[issue14191] argparse doesn't allow optionals within positionals

2013-04-18 Thread paul j3
paul j3 added the comment: Glenn Take a look at http://bugs.python.org/issue15427 I took a stab at changing the documentation, including recommending parse_known_args when porting optparse uses. -- ___ Python tracker <http://bugs.python.

[issue14364] Argparse incorrectly handles '--'

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

[issue16308] Undocumented (?) behaviour change in argparse from 3.2.3 to 3.3.0

2013-04-18 Thread paul j3
paul j3 added the comment: I submitted a patch to http://bugs.python.org/issue9253 The reason why subparser became optional in the latest release is that a old test for missing positionals was phased out, and new one added. Subparsers have always had a default 'required=False', b

[issue14364] Argparse incorrectly handles '--'

2013-04-18 Thread paul j3
paul j3 added the comment: The patch that I recently submitted for http://bugs.python.org/issue13922 appears to solve this issue. It only removes the '--' that marked the end of options. With: parser = argparse.ArgumentParser() parser.add_argument('-f','--foo&

[issue17409] resource.setrlimit doesn't respect -1

2013-04-20 Thread Paul Price
Paul Price added the comment: Thanks! -- ___ Python tracker <http://bugs.python.org/issue17409> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue3132] implement PEP 3118 struct changes

2013-04-22 Thread Paul Hoffman
Paul Hoffman added the comment: Following up on http://mail.python.org/pipermail/python-ideas/2011-March/009656.html, I would like to request that struct also handle half-precision floats directly. It's a short change, and half-precision floats are becoming much more popular in applica

[issue10513] sqlite3.InterfaceError after commit

2013-04-22 Thread Paul Melis
Paul Melis added the comment: Here's a patch that removes the pysqlite_do_all_statements(self, ACTION_RESET, 0); call. It also adds the sqlite error code to one of the exceptions raised, as the error message is misleading in case the ACTION_RESET is left in (I forgot what sqlite err

[issue3132] implement PEP 3118 struct changes

2013-04-22 Thread Paul Hoffman
Paul Hoffman added the comment: Whoops, never mind. Thanks for the pointer to 11734. -- ___ Python tracker <http://bugs.python.org/issue3132> ___ ___ Python-bug

[issue11734] Add half-float (16-bit) support to struct module

2013-04-22 Thread Paul Hoffman
Paul Hoffman added the comment: Just another voice for seeing this put in a deployed version of Python. Half-precision floats are becoming more common in applications. Question: does adding this affect math.isnan and math.isinf? -- nosy: +paulehoffman

[issue14191] argparse doesn't allow optionals within positionals

2013-04-22 Thread paul j3
paul j3 added the comment: The attached file has a 'parse_intermixed_args()' that has the same API as 'parse_known_args()'. It follows the two parse step model args, remaining_args = optionals.parse_known_args() args, extras = positionals.parse_known_args(remaining

[issue9849] Argparse needs better error handling for nargs

2013-04-23 Thread paul j3
paul j3 added the comment: This nargs test using the formater applies only when the container has a help formatter. That is true for a ArgumentParser, but not for an argument_group. group = parser.add_argument_group('g') group.add_argument('bar', nargs='test&#

[issue11734] Add half-float (16-bit) support to struct module

2013-04-23 Thread Paul Hoffman
Paul Hoffman added the comment: Mark: >I don't see how math.isnan or math.isinf would be affected: we're not >proposing to make a float16 Python type, so math.isnan would never encounter a >float16 value. I was assuming that this proposal would also make this part of class

[issue11734] Add half-float (16-bit) support to struct module

2013-04-23 Thread Paul Hoffman
Paul Hoffman added the comment: I *think* what you are saying is that there will be no float16 type, but the result of struct.unpack('eorwhatever', packed_stuff)[0] will be the same as struct.unpack('f', packed_stuff)[0], yes? If so, that's what I wanted. I don'

[issue14191] argparse doesn't allow optionals within positionals

2013-04-23 Thread paul j3
paul j3 added the comment: Yes, http://bugs.python.org/msg166175 does use 'parse_args' in the second call. But I think things would be more flexible if we had a second function: def parse_???(self, args=None, namespace=None): args, argv = self.parse_intermixed_args(args,

[issue9849] Argparse needs better error handling for nargs

2013-04-23 Thread paul j3
paul j3 added the comment: This patch adds a value test for nargs during add_argument. The core of the new test is in ArgumentParser._check_argument. add_argument() now calls ArgumentParser._check_argument(), which calls _format_args(). If it gets a TypeError, it raises a metavar ValueError

[issue9849] Argparse needs better error handling for nargs

2013-04-23 Thread paul j3
paul j3 added the comment: The attached test_nargswarn.py file tests the argparse.py patch. It tries out various nargs values, both for parsers, groups, and mutually exclusive groups. I intend to recast these to work in test_argparse.py -- Added file: http://bugs.python.org

[issue9849] Argparse needs better error handling for nargs

2013-04-24 Thread paul j3
paul j3 added the comment: This is a revision of yesterday's patch. It includes a couple of test cases that check that parser, groups, and exclusive groups all produce the error message. I also changed the metavar tuple case to return an ArgumentError, and changed test_argpar

[issue16970] argparse: bad nargs value raises misleading message

2013-04-24 Thread paul j3
paul j3 added the comment: http://bugs.python.org/issue9849 also deals with nargs values. However there the focus is on string values like '1', not whether an integer value can be 0 or <0. I submitted a patch that moves the nargs testing to a ArgumentParser._check_argument(

[issue16970] argparse: bad nargs value raises misleading message

2013-04-25 Thread paul j3
paul j3 added the comment: An integer nargs value is only used in one of 2 ways, range(nargs) '%s'*nargs In both a negative value acts the same as a 0. I don't think the original authors though much about 'what if the code user gives a negative value?', because

[issue16142] ArgumentParser inconsistent with parse_known_args

2013-04-29 Thread paul j3
paul j3 added the comment: Correction: The patch I gave in the last message produces: >>> parser.parse_known_args(['-ku']) (Namespace(known=False), ['u']) It doesn't take action on the '-k', and puts 'u&#x

[issue17878] There is no way to get a list of available codecs

2013-04-30 Thread Paul Moore
New submission from Paul Moore: The codecs module allows the user to register additional codecs, but does not offer a means of getting a list of registered codecs. This is important, for example, in a tool to re-encode files. It is reasonable to expect that such a tool would offer a list of

[issue10513] sqlite3.InterfaceError after commit

2013-05-01 Thread Paul Melis
Paul Melis added the comment: Just a bit more info on the patch. When running stock Python 2.7.4 the attached test script bug-binding_parameter_0.py returns: module: 2.6.0 sqlite: 3.7.9 Archives Archives/2011 Archives/2012 Traceback (most recent call last): File "bug-binding_parameter

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

2013-05-02 Thread paul j3
paul j3 added the comment: Looks like the text = text.strip() at the end of the set of regex (in _format_actions_usage) needs to be replaced with something that removes all excess spaces, e.g. text = _re.sub( '\s+', ' ', text ).strip() -

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Paul Moore
Paul Moore added the comment: @doerwalter In that case, I'd take the view that such a codec should simply not return anything. The discovery mechanism can be limited to returning only statically discoverable codec names (and it can be documented as such). The original use case was to su

[issue17878] There is no way to get a list of available codecs

2013-05-02 Thread Paul Moore
Paul Moore added the comment: On 2 May 2013 16:35, Dmi Baranov wrote: > Paul, result as iterable of CodecInfo objects is gives much more > flexibility than the names of codecs (whats if you will have a few codecs > with the same name in different SearchObjects?) Works for me. My us

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

2013-05-02 Thread paul j3
paul j3 added the comment: In the test case: class TestMutuallyExclusiveManySuppressed even with a short 'eggs' argument, there is a difference Old usage would be: usage: PROG [-h] [--eggs EGGS] new usage: PROG [-h] [--eggs EGGS] i.e. 2 v 1 space. But extra spaces are not as

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

2013-05-03 Thread paul j3
paul j3 added the comment: I see three solutions - 1) gholms' patch which removes '() ' and [] ' 2) Yogesh's patch which removes all duplicated spaces. 3) remove the 2 asserts. The first 2 do the same thing most of the time, but may differ if the user somehow

[issue17903] Python launcher for windows should search path for #!/usr/bin/env

2013-05-04 Thread Paul Moore
New submission from Paul Moore: The Python launcher for windows should recognise a hashbang line of #!/usr/bin/env python, and use the python executable found on PATH to run the script. If no python executable is present on PATH the launcher should fall back to the current behaviour (using

[issue17903] Python launcher for windows should search path for #!/usr/bin/env

2013-05-05 Thread Paul Moore
Paul Moore added the comment: There is a patch for this (against the standalone pylauncher project) at https://bitbucket.org/pmoore/pylauncher. -- keywords: +patch ___ Python tracker <http://bugs.python.org/issue17

[issue14191] argparse doesn't allow optionals within positionals

2013-05-06 Thread paul j3
paul j3 added the comment: This is a revision of the test_intermixed.py that I submitted earlier. Now `parse_intermixed_args` acts like `parse_args', and calls `parse_known_intermixed_args`. Again it is form that can exercise the idea without modifying `argparse.py`. If the parse

[issue14191] argparse doesn't allow optionals within positionals

2013-05-06 Thread paul j3
paul j3 added the comment: This is the formal patch corresponding to the `test_intermixed.py`. It includes changes to `argparse.rst`, plus tests in `test_argparse.py`. These tests are near the end, after those for `parse_known_args`. They are roughly equivalent to the examples in

[issue11354] argparse: nargs could accept range of options count

2013-05-08 Thread paul j3
paul j3 added the comment: Wouldn't it be simpler to use the re {m,n} notation to grab the appropriate number of arguments? In ArgumentParser _get_nargs_pattern we could add: +# n to m arguments, nargs is re like {n,m} +elif is_mnrep(nargs): +nargs_pa

[issue11354] argparse: nargs could accept range of options count

2013-05-09 Thread paul j3
paul j3 added the comment: I think this patch should build on http://bugs.python.org/issue9849, which seeks to improve the error checking for nargs. There, add_argument returns an ArgumentError if the nargs value is not a valid string, interger, or it there is mismatch between a tuple

[issue11354] argparse: nargs could accept range of options count

2013-05-09 Thread paul j3
paul j3 added the comment: This patch adds this `nargs='{m,n}'` or `nargs=(m,n)` feature. It builds on the `better nargs error message` patch in http://bugs.python.org/msg187754 It includes an argparse.rst paragraph, changes to argparse.py, and additions to test_argparse.py.

[issue14191] argparse doesn't allow optionals within positionals

2013-05-10 Thread paul j3
paul j3 added the comment: 'parse_fallback_args()' function is only in the 'test_intermixed.py' file, not the patch. It should be in the 'if __name__' section of that file, along with the modified 'exit()' method, since it is part of these

[issue14191] argparse doesn't allow optionals within positionals

2013-05-10 Thread paul j3
paul j3 added the comment: I should note one caveat: As a consequence of setting nargs to 0 for the first 'parse_know_args' step, all positional entries in the namespace get an empty list value ([]). This is produced by 'ArgumentParser._get_values'. With the builtin

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

2013-05-12 Thread paul j3
paul j3 added the comment: I'm following a dozen argparse issues with patches. I haven't seen much posting by argparse experts (like bethard, david.murry) since last December. -- ___ Python tracker <http://bugs.python.o

[issue17940] extra code in argparse.py

2013-05-12 Thread paul j3
paul j3 added the comment: I was wondering about that block of code earlier. It would be a good idea to look at what func() does, just to make sure there aren't any side effects - e.g. set maximum line length, required indention, etc. -- nosy: +pa

[issue17965] argparse does not dest.replace('-', '_') for postionals

2013-05-12 Thread paul j3
New submission from paul j3: "16.4.3.11. dest For optional argument actions,... Any internal - characters will be converted to _ characters to make sure the string is a valid attribute name." In _get_optional_kwargs(), dest = dest.replace('-', '_'); but

[issue14046] argparse: assertion failure if optional argument has square/round brackets in metavar

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

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

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

[issue17966] Lack of consistency in PEP 8 -- Style Guide for Python Code

2013-05-12 Thread Paul Jurczak
New submission from Paul Jurczak: This may be too subjective, but here it goes: PEP 8 discourages vertical alignment: "More than one space around an assignment (or other) operator to align it with another", but contrary to this rule, vertical alignment is used many times in the same

[issue14191] argparse doesn't allow optionals within positionals

2013-05-12 Thread paul j3
Changes by paul j3 : Removed file: http://bugs.python.org/file29880/mixed.patch ___ Python tracker <http://bugs.python.org/issue14191> ___ ___ Python-bugs-list mailin

[issue17965] argparse does not dest.replace('-', '_') for positionals

2013-05-12 Thread paul j3
Changes by paul j3 : -- title: argparse does not dest.replace('-', '_') for postionals -> argparse does not dest.replace('-', '_') for positionals ___ Python

[issue17966] Lack of consistency in PEP 8 -- Style Guide for Python Code

2013-05-13 Thread Paul Jurczak
Paul Jurczak added the comment: Correct, it is in mixed prose and code. However, the underlying principle in this PEP is: "guidelines provided here are intended to improve the readability of code". The author used vertical alignment (for mixed prose and code), because of it

[issue17966] Lack of consistency in PEP 8 -- Style Guide for Python Code

2013-05-13 Thread Paul Jurczak
Paul Jurczak added the comment: I admit, it is somewhat silly, but not entirely silly. -- ___ Python tracker <http://bugs.python.org/issue17966> ___ ___ Python-bug

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-13 Thread paul j3
paul j3 added the comment: I've played a bit the idea that barthard sketched. I don't have all the details worked out, but I believe this is what will happen: With parser = argparse.ArgumentParser() parser.add_argument('-w') parser.add_argument('-x', nargs

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-14 Thread paul j3
paul j3 added the comment: I need to make one correction to my last post: '-x 1 2 -w 3 4 5 6', # w:3, x:[1,2], y:4, z:[5,6] + # w:3, x:[1], y:2, z:[4,5,6] - The second solution is only possible if 'z' is not consumed when 'y' is

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-17 Thread paul j3
paul j3 added the comment: This patch implements, I think, the ideas bethard proposed. It is test patch, not intended for production. Most of work is in ArgumentParser._get_alt_length() which - generates a pattern along the lines bethard proposed - generates a string like arg_strings_pattern

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-17 Thread paul j3
paul j3 added the comment: This is a test file for the patch I just submitted. It is not a formal unitttest, but uses print output as much as assert. Cases include the example bethard used, as well as ones from test_argparse.py that initially caused problems. -- Added file: http

[issue12641] Remove -mno-cygwin from distutils

2013-05-21 Thread Paul Moore
Changes by Paul Moore : -- nosy: +pmoore ___ Python tracker <http://bugs.python.org/issue12641> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12641] Remove -mno-cygwin from distutils

2013-05-21 Thread Paul Moore
Paul Moore added the comment: +1 for Oscar's proposed fix. It sounds like a sensible approach. -- ___ Python tracker <http://bugs.python.org/issue12641> ___ ___

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-23 Thread paul j3
paul j3 added the comment: Here's another approach to the problem, using an iterative localized search. For simple cases it produces the same thing, but in complex cases it is more robust. It is based on two ideas: - if the action in consume_optional() is being 'greedy',

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-23 Thread paul j3
Changes by paul j3 : Removed file: http://bugs.python.org/file30349/argparse_7.py ___ Python tracker <http://bugs.python.org/issue9338> ___ ___ Python-bugs-list mailin

[issue9338] argparse optionals with nargs='?', '*' or '+' can't be followed by positionals

2013-05-23 Thread paul j3
paul j3 added the comment: Oops, I attached the wrong file. Here's the correct one. -- Added file: http://bugs.python.org/file30350/issue9338_7.patch ___ Python tracker <http://bugs.python.org/i

[issue12641] Remove -mno-cygwin from distutils

2013-05-23 Thread Paul Moore
Paul Moore added the comment: On 23 May 2013 20:11, Roumen Petrov wrote: > > Is this approach acceptable? > It is not enough. > Support for compilers other than gcc (including cross-compilers) is a separate issue, and one which is much less likely to

[issue17204] argparser's subparsers.add_parser() should accept an ArgumentParser

2014-10-09 Thread paul j3
paul j3 added the comment: In the attached patch I modified 'add_parser' to take a 'parser' keyword parameter. If given, it is used as the parser, rather than create a new one. Thus an existing parser, or one created with a custom ArgumentParser class, could be used a

[issue19643] shutil rmtree fails on readonly files in Windows

2014-10-16 Thread Paul Moore
Paul Moore added the comment: Not a bad idea. I would want the implementation to remain in the documentation as well, as code that wants to be portable back to earlier versions of Python will need it. But for code that targets Python 3.5+ only, having it available "out of the box"

[issue22683] bisect index out of bounds issue

2014-10-21 Thread Paul Ianas
New submission from Paul Ianas: The precondition for all the bisect functions is implemented like this: if lo < 0: raise ValueError('lo must be non-negative') if hi is None: hi = len(a) Now, of course, if hi is given, and hi >= 2 * len(a), then we get an

[issue22683] bisect index out of bounds issue

2014-10-22 Thread Paul Ianas
Paul Ianas added the comment: Sure, it is your call. As said, this is rather an enhancement. Still, if I were to decide, I would chose: 1. not to break the API <=> raise IndexError instead of ValueError in case hi is invalid. 2. to protect against illegal values: as said, if hi <

[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2014-10-24 Thread paul j3
paul j3 added the comment: A possible problem with this patch is that it overrides any Namespace given by the user. In the test example: parser.parse_args(['X'], namespace=argparse.Namespace(foo=3)) the result is 'foo=2', the setdefault from the subparser. Previously

[issue22672] float arguments in scientific notation not supported by argparse

2014-10-24 Thread paul j3
paul j3 added the comment: This issue has already been raise in http://bugs.python.org/issue9334 argparse does not accept options taking arguments beginning with dash (regression from optparse) There I proposed leaving '_negative_number_matcher' unchanged, but only use

[issue22672] float arguments in scientific notation not supported by argparse

2014-10-25 Thread paul j3
paul j3 added the comment: Patch tests are added to an existing 'Lib/test/test_argparse.py' file. I use existing test cases as a pattern any new tests. - Your test file runs fine with the patch I proposed for Issue 9334. - The argparse

[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Paul Moore
Paul Moore added the comment: This looks reasonable to me. -- ___ Python tracker <http://bugs.python.org/issue22730> ___ ___ Python-bugs-list mailing list Unsub

[issue22730] ensurepip should work with pythonw.exe

2014-10-26 Thread Paul Moore
Paul Moore added the comment: Wait, sorry I misread the discussion (long day here). If we can do this in pip yes that would be better. It looks like we can detect when we're being run via pythonw by checking if sys.stdout is None. -- ___ P

[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2014-10-26 Thread paul j3
paul j3 added the comment: I'm exploring modifying that patch by adding a 'subnamespace' attribute to the subparsers Action object. This would give the user, or the main parser control over the namespace that is passed to a subparser. For example: subnamespace

[issue11874] argparse assertion failure with brackets in metavars

2014-10-28 Thread paul j3
paul j3 added the comment: The patch with a major rewrite of '_format_actions_usage' handles this usage problem correctly: usage: try_para_in_meta.py [-h] input_file(s) [input_file(s) ...] The error is the result of usage group formatter trying to remove excess `()`. To give

[issue22782] Python 3.4.2 Windows installer - cannot install 32 bit then 64 bit version

2014-11-01 Thread Paul Moore
New submission from Paul Moore: When you install Python 3.4.2 32 bit and 64 bit on the same PC, in that order, the second one you install shows a red error message on the install screen, saying "This update will replace your existing Python 3.4 installation", and proceeds to uninst

[issue22848] Subparser help does not respect SUPPRESS argument

2014-11-12 Thread paul j3
paul j3 added the comment: A notational point - you are adding a subparser, not an argument, to the subparsers action. Why would a user want to use `help=argparse.SUPPRESS`, as opposed to simply omitting the `help` parameter? The effect would be the same as your patch. Another

[issue22884] argparse.FileType.__call__ returns unwrapped sys.stdin and stdout

2014-11-29 Thread paul j3
paul j3 added the comment: Related issues are: http://bugs.python.org/issue13824 - argparse.FileType opens a file and never closes it http://bugs.python.org/issue14156 - argparse.FileType for '-' doesn't work for a mode of 'rb' As discussed earlier FileType was m

[issue22909] [argparse] Using parse_known_args, unknown arg with space in value is interpreted as first positional arg

2014-11-29 Thread paul j3
paul j3 added the comment: This an issue for parse_args as well. parse_args just calls parse_known_args, and raises an error if extras is not empty. Early on in parsing, it tries to classify argument strings as either optionals (--flags) or positionals (arguments). And there's an exp

[issue22909] [argparse] Using parse_known_args, unknown arg with space in value is interpreted as first positional arg

2014-11-29 Thread paul j3
paul j3 added the comment: Duplicate of http://bugs.python.org/issue22433 -- resolution: -> duplicate ___ Python tracker <http://bugs.python.org/issu

[issue22989] HTTPResponse.msg not as documented

2014-12-03 Thread Paul Hartmann
New submission from Paul Hartmann: HTTPResponse.msg is documented as a http.client.HTTPMessage object containing the headers of the response [1]. But in fact this is a string containing the status code: >>> import urllib.request >>> req=urllib.request.urlopen('http:/

[issue23199] libpython27.a in amd64 release is 32-bit

2015-01-24 Thread Paul Moore
Paul Moore added the comment: There's a lot of politics around the mingw vs mingw64 situation, but in practice I believe the various mingw64 builds are fine. So I see no reason not to supply a correct 64-bit libpythonXY.a. When the patch was made to include the libpythonXY.a file to th

[issue23437] Make user scripts directory versioned on Windows

2015-02-10 Thread Paul Moore
New submission from Paul Moore: Patch to make the user scripts directory on Windows %APPDATA%\Python\PythonXY\Scripts rather than %APPDATA%\Python\Scripts. See the thread "PEP 370 - per-user scripts directory on Windows" (Feb 10 2015) on python-dev for discussion, but essentially

[issue23437] Make user scripts directory versioned on Windows

2015-02-10 Thread Paul Moore
Paul Moore added the comment: Cool, I've just run the tests by manually patching a 3.5a0 install. No extra failures, so things look fine. (Interestingly, before patching, test_site "altered the execution environment" but afterwards it didn't - it just succeeded. I don&

[issue23437] Make user scripts directory versioned on Windows

2015-02-10 Thread Paul Moore
Paul Moore added the comment: Sorry, yes pip just installs into %APPDATA%\Python\Python35\Scripts with no issues. -- ___ Python tracker <http://bugs.python.org/issue23

[issue23461] Building on windows modifies importlib.h

2015-02-13 Thread Paul Moore
New submission from Paul Moore: When building Python (cpython repository, tip revision on the default branch) using Visual Studio 2015 (version downloaded 12/02/2015) I get a message in the build: C:\Work\Projects\cpython\PCbuild\_freeze_importlib.vcxproj(98,5): error : importlib.h has been

[issue23461] Building on windows modifies importlib.h

2015-02-13 Thread Paul Moore
Paul Moore added the comment: Ah. It's 4K lines of everything changing. Looks like it might be an EOL issue. The build seems to be changing it from LF line endings to CRLF line endings. -- ___ Python tracker <http://bugs.python.org/is

[issue23461] Building on windows modifies importlib.h

2015-02-13 Thread Paul Moore
Paul Moore added the comment: I'm just about finished for the night but I'll try the eol extension tomorrow. I don't really use it much, though, my practice is generally to make all my tools use LF. I certainly didn't do anything that would change that file, so something

[issue23461] Building on windows modifies importlib.h

2015-02-13 Thread Paul Moore
Paul Moore added the comment: No, enabling the eol extension didn't fix it :-( -- ___ Python tracker <http://bugs.python.org/issue23461> ___ ___ Python-bugs-l

[issue23461] Building on windows modifies importlib.h

2015-02-13 Thread Paul Moore
Paul Moore added the comment: Correction. Looks like if I enable the eol extension, then hg revert importlib.h, then rebuild, the problem then goes away. So basically you need the eol extension enabled *before* you update/clone your checkout

[issue23461] Building on windows modifies importlib.h

2015-02-14 Thread Paul Moore
Paul Moore added the comment: Martin, thanks for the clarification. When I said "I don't use it much" what I meant was that I've never had it enabled, and for all of the repositories I use, not doing so has never been a problem (until now). In contrast, git's a

[issue23465] Implement PEP 486 - Make the Python Launcher aware of virtual environments

2015-02-14 Thread Paul Moore
New submission from Paul Moore: Implementation of PEP 486 (Make the Python Launcher aware of virtual environments). Tested manually on my local PC - there aren't currently any tests for the launcher that I can see (and I'm not entirely sure how I'd write such a test) so the

[issue23437] Make user scripts directory versioned on Windows

2015-02-14 Thread Paul Moore
Paul Moore added the comment: Sorry, I should probably have added them to the patch in the first place :-) -- ___ Python tracker <http://bugs.python.org/issue23

[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-20 Thread Paul Moore
New submission from Paul Moore: This is the patch for PEP 441 (Zip Application Support). Steve, could you check the installer changes, please? I haven't managed to get a setup where I can test the installer, and I'm not aware of any WiX coding tools, so I just edited the XML fil

[issue23491] PEP 441 - Improving Python Zip Application Support

2015-02-20 Thread Paul Moore
Paul Moore added the comment: Thanks for checking, Steve. I don't get an installer because of the checksum error quoted, although I did get the component msi files. As far as content type is concerned, I wasn't sure what effect it had so I just copied what was there. I guess appli

<    19   20   21   22   23   24   25   26   27   28   >