paul j3 added the comment:
Let's see if I understand the proposed patch
Each call to 'take_action' is replaced with a save to a 'action_with_values'
dictionary
For a flagged (optional) it saves the 'args' and 'option_string'; for
positionals
paul j3 added the comment:
http://stackoverflow.com/a/35144270/901925
dynamically-set-default-value-from-cfg-file-through-argparse-python
is my answer to a similar recent (Feb 2015) SO question.
I rather like the idea of using collections.ChainMap on the dictionary versions
of the namespace
paul j3 added the comment:
Yes, the use of ordered dictionary would be right. Your code would still
reorder actions that have fallback values, but that wouldn't affect others.
Yes, a fallback hook at the end of parsing would have to be placed before the
'required' testing, not
paul j3 added the comment:
This ArgumentDefaultHelpFormatter issue should probably be raised in its own
issue. It applies to 'required' optionals, but any patch would be independent
of the issues discussed here.
This class defines a method that adds the '%(default)' s
paul j3 added the comment:
By text and location the sidebar does not apply specifically to this example.
It applies to the whole page, 'This page contains the API reference
information.'
Documentation for argparse is indeed a problem - both because of its complexity
and how
paul j3 added the comment:
Is this the kind of scenario that you have problems with?
parser = argparse.ArgumentParser()
sp = parser.add_subparsers(dest='cmd')
p1 = sp.add_parser('cmd1')
p1.add_argument('-f')
p2 = sp.add_parser('cmd2&
paul j3 added the comment:
I can see changing the group title from 'optional arguments' to 'options' or
'optionals'
parser._optionals.title
'optional arguments'
But I don't think there's a need to change references in the code or it
paul j3 added the comment:
Neither 'parents' or 'resolve' are documented in any detail. Most of what I
know comes from reading the code.
'parents' are, I think, most useful when importing a parser from some other
module. It lets you add arguments to your own p
paul j3 added the comment:
I made a mistake of trying to add to or refine a closed patch. Maybe I need to
move the dbldash.patch over here for more formal consideration.
--
___
Python tracker
<http://bugs.python.org/issue14
Changes by Paul Morelle :
--
nosy: +madprog
___
Python tracker
<http://bugs.python.org/issue18987>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Paul Sokolovsky :
--
nosy: +pfalcon
___
Python tracker
<http://bugs.python.org/issue1103213>
___
___
Python-bugs-list mailing list
Unsubscribe:
paul j3 added the comment:
The best way to get an idea added is to write a good complete patch. 2nd best
is to provide constructive input on ideas that are already here. 3rd is to
illustrate how you would hope to use such a feature. Include ideas on how the
usage/help/error display would
paul j3 added the comment:
desbma:
Rereading your latest code and comment:
> * The meaning of the 'type' parameter for StoreEnumAction is somewhat
> different than for other actions (enum class vs callable that validates)
it occurred to me that that parameter does not have t
Changes by Paul Moore :
--
nosy: -paul.moore
___
Python tracker
<http://bugs.python.org/issue24557>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Paul Ellenbogen:
If a shelve is opened, then the processed forked, sometime the shelve will
appear to work in the child, and other times it will throw a KeyError. I
suspect the order of element access may trigger the issue. I have included a
python script that will exhibit
Paul Ellenbogen added the comment:
I think this behavior is due to the underlying behavior of the dbm. The same
code using dbm, rather than shelve, also throws KeyErrors:
from multiprocessing import Process
import dbm
db = dbm.open("example.dbm", "c")
for i in range(100):
New submission from Paul Moore:
People often look towards collections.namedtuple when all they actually want is
"named attribute" access to a collection of values, without needing a tuple
subclass, or positional access. In these cases, types.SimpleNamespace may be a
better fit.
Paul Moore added the comment:
Thanks Victor. I'll sort this out this evening when I get to my PC with access
to the CPython repo.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Paul Moore :
--
resolution: -> fixed
stage: needs patch -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Paul Moore added the comment:
Ah, thanks. I probably did the commit the wrong way round in that case, as I
committed to tip. How should I do the commit into 3.5? (I'm also somewhat
confused by the fact that hg describes the 3.5 branch as &quo
paul j3 added the comment:
I just found a case where `dest` is `SUPPRESS` - the default subparsers setup.
_SubParsersAction(option_strings=[], dest='==SUPPRESS==', nargs='A...',
...
If I make this Action 'required' (in the current distribution 'subpar
New submission from Paul Sokolovsky:
See
https://docs.python.org/3/library/struct.html#struct.pack_into
https://docs.python.org/3/library/struct.html#struct.unpack_from
Actual source contains code like:
if (offset < 0)
offset += vbuf.len;
to allow specify offsets from the end o
paul czyzewski added the comment:
I'm new to IDLE. I just upgraded to Mac El Capitan from Snow Leopard, and
installed Python 3.5.1 (v3.5.1:37a07cee5969, Dec 5 2015, 21:12:44).
I have had the IDLE window freeze so many times (when clicking on something in
the autocomplete window as desc
paul czyzewski added the comment:
Thanks, Terry and Ned.
Ned, I checked (nice clear instructions, btw) and I had Tk 8.5.10. So I
followed the link and installed 8.5.18. -- The freeze on mac still occurs but
I understand that this will avoid some other bugs.
BTW, I don't know how te
Changes by paul j3 :
--
priority: normal -> high
___
Python tracker
<http://bugs.python.org/issue26967>
___
___
Python-bugs-list mailing list
Unsubscrib
paul j3 added the comment:
It's been 2 years since I worked on this patch. In the issue discussion
http://bugs.python.org/issue14910 there was no mention of short v long options.
The unit tests only look at longs.
The result is that with the abbrev off, it disables all use of com
paul j3 added the comment:
Argument Groups are not designed for nesting, and despite their names and
subclassing, Mutually exclusive groups and Argument Groups are not meant to be
used together (with one exception).
I agree that the error is obscure, but it occurs in a particularly fragile
paul j3 added the comment:
Someone needs to take the current argparse.py, set the default value of this
parameter to False, and run the unittest file. This should turn up this case,
and possibly others that fail when abbreviations are turned off. Then we have
to debate whether such failures
paul czyzewski added the comment:
> Question: does the text widget freezes on button down or not until button up.
> The experiment is to press and hold the button while moving the mouse. Does
> the cursor move and select text while the button is down, or does it freeze
> immedi
paul czyzewski added the comment:
hi Tal and Terry,
I hadn't noticed that continuing to type does go to the appropriate spot.
However, I see what I think are two or three bugs (not sure is 'a)' is a bug)
in the behavior:
a) on my system it does not visibly filter the list
paul czyzewski added the comment:
hi Terry, thanks for all the responses.
Well, what *I* found maddening was that typing "os." pause "g" works but
typing "os.g" (with no pause) does nothing. :) But, anyway, I guess you're
saying that that's as
paul czyzewski added the comment:
>If you use the arrow keys to select and copy as you go, you still have
> to hit tab twice to close the box (or click elsewhere).
Not for me. If i use arrow keys then I just type "()" and the box disappears.
So there's two(?) fewer key
paul j3 added the comment:
I answered a similar question recently on Stackoverflow when the user wanted to
use `type=hex`.
http://stackoverflow.com/questions/37006387/python-argparse-hex-error
In another recent bug/issue the poster want a `enum` type. It's not hard to
define a functio
paul j3 added the comment:
So far I've proposed adding a 'hook' at the end of '_parse_known_args', that
would give the user access to the 'seen_non_default_actions' variable. This
function could perform an almost arbitrarily complex set of logical
co-occurr
New submission from Paul Bloch:
Python 2.7.6 writes the version number (2.7.6) into the installed receipts.
Python 2.7.11 calls the version "0". That isn't very helpful for managed
installs.
--
components: Macintosh
files: typescript.txt
messages: 265891
nosy: Paul B
New submission from Paul Moore:
By default, the launcher tries to launch (the latest version of) Python 2 on
the user's machine. This can be altered with the configuration file, and if the
user doesn't have Python 2 installed Python 3 will be used. Now that we are at
Python 3.6,
Paul Moore added the comment:
Thanks Steve. I wasn't sure over versioning, which is why I decided to be
conservative. Also, it's probably not good to change the default behaviour on
people when they just install a patch rele
Paul Moore added the comment:
Because of the nature of the launcher, there's not much we can do about that
IMO. And there was no real objection to changing the default on the
python-ideas thread (at least for interactive use).
But I'll wait to see if Ned has anyth
Paul Moore added the comment:
Thanks Ned. Personally, I'm still inclined *not* to add this to 2.7/3.5. People
will get it when the install the 3.6 alphas, sure, but that seems to me to be a
relatively obvious consequence of installing an alpha that includes a component
that's us
Paul Moore added the comment:
Terry: Correct.
As 3.4 is in security fix mode, and 2.7 doesn't come with the launcher (which I
hadn't realised - thanks for pointing this out Zach!) the only real backport
candidate is 3.5, so I definitely don't think it's worth backpo
Paul Moore added the comment:
OK, no problem. Like you say, not a high priority.
--
___
Python tracker
<http://bugs.python.org/issue27064>
___
___
Python-bug
Changes by Paul Moore :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue27064>
___
___
Python-bugs-list
Paul Moore added the comment:
My instinct is that this should only go into 3.6. It's a remote possibility,
but someone could otherwise write code that uses REG_DWORD64 and say that it
"works on 3.5" because they tested on 3.5.x, only to have it fail on 3.5.1.
But if someone wit
Paul Moore added the comment:
I'm not sure I follow your comment. In Python 3.5,
>>> from winreg import REG_QWORD
Traceback (most recent call last):
File "", line 1, in
ImportError: cannot import name 'REG_QWORD'
So exposing REG_QWORD from the winreg mod
Paul Moore added the comment:
Hmm, OK. So code that currently needs to access QWORD values and decodes the
bytes returned would be broken by this change. Equally it is possible (albeit
not ideal) to get the data out with the current behaviour.
I can't judge how likely it is that anyon
Paul Moore added the comment:
> As an alternative, virtualenv could be changed to create a pyvenv.cfg file
> with the interpreter version like pyvenv does. Seems pretty simple and
> unproblematic to me and it might actually be useful to know the interpreter
> version without r
Paul Moore added the comment:
Thanks, I'll fix for the next iteration of the patch.
--
___
Python tracker
<http://bugs.python.org/issue23491>
___
___
Pytho
Paul Moore added the comment:
I don't follow (and I don't really want to do things this low level without a
compelling reason...)
--
___
Python tracker
<http://bugs.python.o
Paul Moore added the comment:
Following on from that, the code to make an archive executable is currently
os.chmod(new_archive, os.stat(new_archive).st_mode | stat.S_IEXEC)
Should I use "... | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH"? If so, do I
need to protect that with
Paul Moore added the comment:
If I understand Steve's comments, the mime type is used by Windows, so
application/zip lets Windows know that this filetype is fundamentally a zip
file (and so it'll offer to open it with your zip program if you right click,
stuff like that).
pxzw -
Paul Moore added the comment:
OK, thanks. I don't propose to go there with the initial implementation. If
it's a problem in practice, someone can raise a bug and we'll fix it then.
(I've never seen actual Python code in the wild t
Changes by Paul Moore :
Removed file: http://bugs.python.org/file38249/pep-441.patch
___
Python tracker
<http://bugs.python.org/issue23491>
___
___
Python-bugs-list mailin
Paul Moore added the comment:
Sorry - typo. Try again...
--
Added file: http://bugs.python.org/file38250/pep-441.patch
___
Python tracker
<http://bugs.python.org/issue23
Paul Moore added the comment:
OK, here is an updated patch based on the python-dev discussions
--
Added file: http://bugs.python.org/file38249/pep-441.patch
___
Python tracker
<http://bugs.python.org/issue23
Paul Moore added the comment:
Serhiy - I just got a notification from the review tool - I'd not used it
before and didn't know to check it. But I've read them now and corrected a
number of places based on your comments and added a few replies to the review.
Thanks
Paul Moore added the comment:
Serihy, thanks for the explanation. I was aware that my replies weren't getting
archived, good to know how to avoid that in future.
I've worked out what you mean over the directory entries now. It was easy
enough to fix - I just removed the is_file ch
Paul Moore added the comment:
The PEP has now been accepted, and as far as I am aware this patch is complete.
If anyone has any review comments, please speak up, otherwise I believe this is
ready to be committed, if some kind soul is willing
Paul Moore added the comment:
Updated patch including (I hope!) all review comments so far.
--
Added file: http://bugs.python.org/file38258/pep-441.v4.patch
___
Python tracker
<http://bugs.python.org/issue23
Paul Moore added the comment:
I'm -1 on this. The whole point of having a .pyz extension is so that you don't
need to use an extension that's for files containing text to hold binary data.
If you want to do this, use zipapp and specify no interpreter line, then add
the @pytho
Paul McMillan added the comment:
While some websites may use urlunparse(urlparse(url)) to validate a url, this
is far from standard practice. Django, for instance, does not use this method.
While I agree we should clean this behavior up, this is not a vulnerability in
core python, and we need
Paul Moore added the comment:
There have been no further comments for a while now. Could this be committed by
someone?
--
___
Python tracker
<http://bugs.python.org/issue23
Changes by Paul Bryan :
--
nosy: +pbryan
___
Python tracker
<http://bugs.python.org/issue15873>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Moore added the comment:
New patch incorporating Berker's comments
--
Added file: http://bugs.python.org/file38389/pep-441.v5.patch
___
Python tracker
<http://bugs.python.org/is
Changes by Paul Moore :
--
nosy: -pmoore
___
Python tracker
<http://bugs.python.org/issue20233>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Paul Moore:
I just tried to install the 64-bit "full installer" version, for
all users with the default options. This is on a PC that hasn't had
3.5 installed before, and doesn't have Visual Studio 2015 installed.
When it got to the step "precompilin
Paul Moore added the comment:
In this case as I said, no previous 3.50a1 installed. and I was doing an "all
users" install (which prompted me for elevation, and I said OK)
--
___
Python tracker
<http://bugs.python.o
New submission from Paul Moore:
When I installed Python 3.4, I included the py.exe launcher. I have just
installed Python 3.5a0, then uninstalled it again, and the py.exe launcher has
gone.
Either the 3.5 installer should notice that py.exe is already present and
remember *not* to uninstall
Paul Moore added the comment:
Sent via private email as it's a work PC and I didn't check what's logged in
there...
--
___
Python tracker
<http://bugs.pyt
New submission from Paul Moore:
With Python 3.5 on Windows defaulting (for all users installs) to the read-only
"Program Files" directory, and with "Add Python to PATH" having problems adding
the per-user "user scripts" directory to PATH, the Python 3.5 docum
Paul Moore added the comment:
At a minimum, the example should show adding setting the 2 script directories
to PATH, and not just sys.prefix.
--
___
Python tracker
<http://bugs.python.org/issue23
Paul Moore added the comment:
Please don't install the installer somewhere, just to add an uninstall icon on
the start menu. It's possible to uninstall via "Add/Remove Programs". That
should be sufficient.
--
___
P
Paul Moore added the comment:
There's a problem with the latest patch, it's lost the MSI updates somehow.
I'll add them back in this evening, please don't commit before a v6 patch is
available,
--
___
Python tracker
<
Paul Moore added the comment:
Steve Dower - could you please review the updated patch here. The WiX changes
specifically are intended to register the .pyz extension with the launcher, but
I can see no code that does this for a per-user install. I've copied the same
code for the .py exte
Paul Moore added the comment:
OK, so if the installer changes look good to you, then this PR is once again
ready to go. Sorry to anyone watching for the glitch.
--
___
Python tracker
<http://bugs.python.org/issue23
New submission from Paul Moore:
Installing Python 3.5a2 with the 64-bit Windows installer using a user-level
install doesn't associate .py files with the new (3.5) version of the launcher.
I encountered this when there was an existing system install of Python 3.4, so
.py files rem
Paul Moore added the comment:
Steve has something like that planned, I believe. It's been discussed a couple
of times on python-dev
--
___
Python tracker
<http://bugs.python.org/is
Paul Moore added the comment:
The patch would need updating to be applicable. Minimum changes I would expect
to be required:
1. Update to build for Python 3.5 (the patch will *not* be included in earlier
versions, as it is a new feature), which means it needs the Visual Studio 2015
build
Paul Moore added the comment:
That sounds reasonable. I'll have a look at this. The code was originally based
on a similar pattern in the zipfile module, so maybe zipfile should be changed
in the same way?
--
___
Python tracker
Paul Moore added the comment:
Thanks Brett! Apologies about the TESTFN issue - I changed it (from
TemporaryDirectory, in fact) based on one of the review comments - it looks
like I didn't test the change properly. My mistake, thanks for catchi
Paul Moore added the comment:
Looks good. Would it be worth adding tests for providing pathlib.Path objects,
or is that overkill?
--
___
Python tracker
<http://bugs.python.org/issue23
Paul Moore added the comment:
Cool, I'll look at sorting it out.
--
___
Python tracker
<http://bugs.python.org/issue23657>
___
___
Python-bugs-list m
Paul Moore added the comment:
Updated version of the patch with tests, plus doc update noting that path
objects are explicitly supported.
--
Added file: http://bugs.python.org/file38513/duck_typed_zipapp.patch
___
Python tracker
<h
Paul Moore added the comment:
Egg files are a format defined by setuptools. If you look in the setuptools
documentation it notes that egg files are simply zipfiles with a particular
structure and naming convention. So from a core Python perspective, you can use
eggs just like any other
Changes by Paul Moore :
--
nosy: +paul.moore
___
Python tracker
<http://bugs.python.org/issue23701>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Paul Sokolovsky:
Under https://docs.python.org/3/howto/descriptor.html#functions-and-methods ,
there're several references to unbound methods (including in expected output
from the interpreter).
As known, unbound methods are gone in Python3, so seeing those are conf
Paul Moore added the comment:
LGTM, just one minor comment in review.
--
nosy: +paul.moore
___
Python tracker
<http://bugs.python.org/issue23681>
___
___
Pytho
Paul Moore added the comment:
Agreed, the test is sufficient documentation. However, I can't make the test
fail here (Windows 7, Python 3.4.3):
>py ti.py
b'spam\n' b'spam\n'
b'eggs\n' b'eggs\n'
b'beans\n' b'beans\n'
>ca
Paul Moore added the comment:
Cool, no problem.
--
___
Python tracker
<http://bugs.python.org/issue23700>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Moore added the comment:
Updated patch. Added the requested test and a set of tests for the command line
API. This also highlighted a bug in the command line --info option, which is
also fixed.
Coverage now:
Name Stmts Miss Cover Missing
Paul Moore added the comment:
> 99% of Python users should be getting a distribution rather than the
> python.org installers
I'm not at all convinced by this logic. On Windows, as far as I'm aware, the
only "major" Python distributions are Anaconda and Enthought, b
Paul Moore added the comment:
One implication of Nick's (and Steve's) position seems to me that we don't view
per-user installs as a key aspect of the python.org installers. And yet the
impression I get of the direction that the 3.5 installers is taking seems to
contradict t
Paul Moore added the comment:
Updated patch with fixes for review comments. I did remove the tests for the
exact error messages, as testing for a non-zero exit code was actually what I
was trying to do, and I found a better way of doing that.
--
Added file: http://bugs.python.org
Paul Moore added the comment:
Personally, I'd like to have 3.5 be the release that changes to using "Program
Files" as the default install, and offers a per-user install to Appdata. I
suspect there will be enough fallout from that change to keep us busy. Let's
look to 3.6
Paul Moore added the comment:
Regarding the "poor relation" argument, I'd see that as the other way round. We
don't have the resources to deal with major breakages, so we should be
relatively cautious.
--
___
Python tracker
<
Paul Moore added the comment:
Sorry, SOE?
--
___
Python tracker
<http://bugs.python.org/issue22516>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Moore added the comment:
I agree with Ned, this sounds like a significant change. In particular,
Portable Python seems to currently only offer 3.2.5 at the moment. And it's not
at all clear to me whether it's a 32-bit or a 64-bit version (but I suspect the
former). One thing I
paul j3 added the comment:
The attached file subclasses ArgumentParser, explores how these optparse
methods might be added to argparse. The __name__ section demonstrates how they
might be used.
argparse differs from optparse in a number of ways:
- all actions are included in the parser
Paul Moore added the comment:
That sounds reasonable. I understand the need for face-to-face discussion on
something like this, although I do think there's been something of a tendency
in the past for things "decided at PyCon" to receive a certain amount of
resistance from peo
Changes by Paul Moore :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
paul j3 added the comment:
It certainly looks like a documentation issue. `action` doesn't make sense
here. `add_subparsers` normally creates an Action of type `_SubParsersAction`.
'action' for normal 'add_argument' command defines the Action type created at
2501 - 2600 of 3213 matches
Mail list logo