paul j3 added the comment:
Errors that are associated with a specific argument, such as a wrong 'type' do
get usage from the appropriate subparser.
e.g.
In [164]: p.parse_args('--foo 1 cmd1 --bar x'.split())
usage: ipython3 cmd1 [-h] [--bar BAR]
ipython3 cmd1: error: argument --bar
paul j3 added the comment:
The subparser is called with `parse_known_args` which just puts unknown args in
a _UNRECOGNIZED_ARGS_ATTR attribute slot in the namespace, which is then passed
back to the main parser.
(this occurs in _SubParsersAction.__call__)
If `parser.parse_known_args
New submission from Paul Pinterits :
In a conversation with Ethan Furman (the author of the enum module) I've been
informed that Enum automatically checks whether the _missing_ method has
returned an instance of the correct class, and raises a TypeError if not.
(Link: https
New submission from Paul Overing :
I have found that using timeout with a python queue.Queue() results in an
average delay of 14.5ms in Windows over Ubuntu in python 3.6.5/3.7, I
subtracted the 1 ms timeout.
I have also tried datetime.datetime.now() to measure the time, with similar
Paul Ganssle added the comment:
Somewhat related: #6697.
Turns out there are already some tests here for this, specifically for the C
version only:
https://github.com/python/cpython/blob/master/Lib/test/datetimetester.py#L3328
--
___
Python
Change by Paul Ganssle :
--
pull_requests: +8434
___
Python tracker
<https://bugs.python.org/issue34454>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue30717>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue34481>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue34423>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
pull_requests: +8336
___
Python tracker
<https://bugs.python.org/issue34454>
___
___
Python-bugs-list mailing list
Unsubscribe:
paul j3 added the comment:
I agree that a custom Action subclass like this is the way to go.
The regular 'append' is implemented in _AppendAction class, which is different
from the default _StoreAction. So even if there was enough demand for this new
idea to be put into development
Paul Ganssle added the comment:
> Note that technically a difference between C and Python implementation of
> fromisoformat() will still remain: if a part of the input string before or
> after the separator contains surrogates, the C code will throw a
> UnicodeEncodeError whil
Paul Ganssle added the comment:
So this is related to something I was actually meaning to fix. When I wrote
this code I didn't understand the way PyUnicode works, there's actually no need
to call `PyUnicode_AsUTF8AndSize()` on the entire unicode string.
My understanding is that each glyph
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue34404>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue1100942>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue34365>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Ganssle added the comment:
For one thing, this is not how pytz is supposed to be used. You have fallen
prey to one of the most common errors when using pytz. See my blog post:
https://blog.ganssle.io/articles/2018/03/pytz-fastest-footgun.html
The issue at hand is also more about what
paul j3 added the comment:
The 'choices' mechanism is quite simple. As noted for testing it simply uses
an 'in' test.
For help formating it uses
choice_strs = [str(choice) for choice in action.choices]
result = '{%s}' % ','.join(choice_strs)
In other words, it's treated
Paul Ganssle added the comment:
> It does not seem to me that two threads have the GIL at the same time.
To be clear, this was never my contention. I was under the impression that if
you take the GIL with PyGILState_Ensure(), the GIL was held until you called
PyGILState_Rele
Paul Ganssle added the comment:
Using a modified version of Python 3.7.0 that prints "Releasing GIL" whenever
PyGILState_Release, I get this:
Waiting for GIL (0)
Gil acquired! (0)
Waiting for GIL (1)
Gil acquired! (1)
Releasing GIL
Gil released! (0)
Releasing GIL
Gil release
New submission from Paul Ganssle :
I was recently debugging some multithreaded Rust code that was deadlocking, and
I tracked it down to what I'm fairly certain is a bug somewhere in
PyCapsule_Import, where it seems that PyCapsule_Import releases the GIL without
first acquiring it.
I've
paul j3 added the comment:
Duplicate of
https://bugs.python.org/issue22909 [argparse] Using parse_known_args, unknown
arg with space in value is interpreted as first positional arg (closed as
duplicate)
https://bugs.python.org/issue22433 Argparse considers unknown optional
arguments
paul j3 added the comment:
Parsing is a two step process. First the strings are passed through
def _parse_optional(self, arg_string):
which classifies them as 'O', an optional flag, or 'A', an argument.
- no prefix char => A
- the string is in the dictionary of option_strings (e.g. '--l
Change by Paul Price :
--
keywords: +patch
pull_requests: +8213
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue34377>
___
___
Python-
New submission from Paul Price :
I've found that the valgrind suppressions don't work for me with cpython 3.6.2.
Renaming PyObject_Free/PyObject_Realloc to _PyObject_Free/_PyObject_Realloc in
the suppressions file works.
I've got a patch that I'll put in via a GitHub PR
Paul Monson added the comment:
The PR hasn't changed since September. Is it still active?
Should I consider updating the libffi_msvc code to support ARM32 in Python?
Completing the switch to libffi makes more sense to me.
I fetched the PR code to my fork and rebased it on the current
Paul Monson added the comment:
I'm interested in getting python working on Windows running on Raspberry Pi
(Thumb-2 instruction set). I can also contribute to ARM64 Windows. I've made
some progress getting ARM32 working on a fork. The next roadblock for my
investigation is libffi support
Paul Moore added the comment:
Oh, and I suspect that the reason that "The thing with the relative path works
if I change the order in the path" is simply because the bit of code that
searches PATH just ignores what's after #!/usr/bin/env and looks for
python.exe. (More or less -
Paul Moore added the comment:
Others use absolute paths, as I mentioned in my reply.
--
___
Python tracker
<https://bugs.python.org/issue34359>
___
___
Pytho
Change by Paul Moore :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue34359>
___
___
Paul Moore added the comment:
>From https://docs.python.org/3.7/using/windows.html#shebang-lines the
>supported shebang lines are
* /usr/bin/env python
* /usr/bin/python
* /usr/local/bin/python
* python
There's a provision in there:
"""
The /usr/bin/env form of shebang
Paul Moore added the comment:
If you're OK with that, I don't see the problem. My objection was with the
claims that ExtensionLoader.get_source shouldn't return None or shouldn't
exist. PEP 302 mandates that loaders have a get_source, and that get_source
should return None if the loader
Paul Moore added the comment:
On Sun, 5 Aug 2018 at 18:10, Brett Cannon wrote:
> One other thing I will say is that the PEP 302 APIs were seemingly designed
> for working with Python source and were not necessarily oriented towards
> alternative code representations that were exec
Paul Moore added the comment:
So, where is the filename coming from? Looking at exception and frame objects,
I don't see a "source filename" attribute anywhere - have I missed something
here?
--
___
Python tracker
<https://bu
Paul Moore added the comment:
On Sun, 5 Aug 2018 at 06:51, Stefan Behnel wrote:
> This whole idea looks backwards and complicated. As Brett noted, .pyc files
> were moved out of the source tree, because they are build time artifacts and
> not sources. With that analogy, it's the
Paul Moore added the comment:
> What's wrong with that? Installing the .pyx sources together with the .so
> compiled modules makes a lot of sense to me: it is very analogous to
> installing the .py sources together with the .pyc byte-compiled files. In
> https://bugs.python.or
Change by paul j3 :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue34299>
___
___
Python-bugs-list
paul j3 added the comment:
Updating you Python3.7 might change the behavior. If I read
https://github.com/python/cpython/commits/master/Lib/argparse.py
correctly, subparsers are no longer required by default (it reverted back to
earlier Py3 behavior). There is a proposed patch
paul j3 added the comment:
The 'choices' mechanism is a simple 'value in choices' test. A dictionary (or
other mapping) works because it works with 'in'.
'type' as noted is the means that argparse provides for transforming an input
string into some other object (most commonly a number
paul j3 added the comment:
Your code runs fine under 3.6.5.
But if I add 'subparsers.required=True', I get your error. It's having
problems formatting the name of the subparsers command when issuing the error
message.
If I add a 'dest' to the add_subparsers I get the expected error
paul j3 added the comment:
argparse does import 'textwrap', but as '_textwrap', so it could be used with:
argparse._textwrap.dedent(...)
Importing your own is cleaner.
--
nosy: +paul.j3
___
Python tracker
<https://bugs.python.org/issue34
paul j3 added the comment:
Do you understand why this is happening?
Subparsers is, in effect, a positional argument with 'choices' - the choices
being the parsers (and their aliases).
But '-dr' looks like an flagged (optionals) argument. Since you didn't define
such an argument, it gets
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue34158>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Moore added the comment:
See https://docs.python.org/3.7/tutorial/floatingpoint.html. Essentially, the
behaviour you are seeing is caused by the fact that the results calculations
you are attempting cannot be exactly represented in binary floating point, so
approximate results
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue27741>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue15390>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue22426>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue5516>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue22377>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue28730>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue9004>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue22005>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Ganssle added the comment:
Oops, that previous comment was intended for a completely different ticket. My
mistake.
--
___
Python tracker
<https://bugs.python.org/issue27
Paul Ganssle added the comment:
Hmm. I never noticed this. In the past I have used the (undocumented)
PyDateTimeAPI struct, which the official macros wrap. I'm not sure how official
that struct is considering it doesn't show up in the documentation.
I agree that it should be possible
Paul Ganssle added the comment:
Hmm. I never noticed this. In the past I have used the (undocumented)
PyDateTimeAPI struct, which the official macros wrap. I'm not sure how official
that struct is considering it doesn't show up in the documentation.
I agree that it should be possible
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue16322>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue25729>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue12750>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Ganssle added the comment:
This is a duplicate of #15873 and #24954 and can be closed, as
`fromisoformat()` was added in Python 3.7.
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue31
Paul Ganssle added the comment:
I believe this can be consolidated with #15873 and closed, since that is
finished and available in Python 3.7.
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue24
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue13305>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue9305>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Ganssle added the comment:
> datetime.timezone -> pytz.timezone (updates driven by IANA timezone database)
I will note that `pytz.timezone` and `datetime.timezone` are not really
comparable (they do two very different things), and as of Python 3.6,
`dateutil.tz` is the recom
Paul Ganssle added the comment:
I don't believe this is a duplicate if #32267, which is actually about the %z
directive.
I think the implementation here is correct and the documentation is
semi-correct, it depends on how you look at it, consider:
>>> datetime(2018, 1, 1, 0
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue33381>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue33940>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue34023>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue6280>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue15443>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue23607>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue33701>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue29097>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Ganssle added the comment:
This can be closed now, I think.
--
___
Python tracker
<https://bugs.python.org/issue10381>
___
___
Python-bugs-list mailin
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue33941>
___
___
Python-bugs-list mailing list
Unsubscribe:
paul j3 added the comment:
`parse_intermixed_args` was added in v 3.7.
https://docs.python.org/3/library/argparse.html#intermixed-parsing
https://stackoverflow.com/questions/50916124/allow-positional-command-line-arguments-with-nargs-to-be-seperated-by-a-flag
Paul Ganssle added the comment:
> I am aware of that. In fact, some of the draft versions of PEP 495
> implementation did contain such code. The problem is that any such
> tz.fromutc() implementation would necessarily change the behavior of the old
> programs.
This I'm no
Paul Ganssle added the comment:
So I created a little patch for this, and when I was working on it I realized
that it's actually possible to implement full `fold` support in a generic way
in `fromutc` under the assumption that `utcoffset - dst` holds at all points
(which is the fundamental
Change by Paul Ganssle :
--
keywords: +patch
pull_requests: +7050
stage: needs patch -> patch review
___
Python tracker
<https://bugs.python.org/issu
Jesse Paul Ogle added the comment:
Greetings, I came across this issue while looking into XDG Base Directory
Specification. This issue is only tagged with version 3.4, but the underlying
issue (not being able to change the history file / size through environment
variables) appears to still
Paul Koning added the comment:
FYI, I'm the one who created this problem back in 2012. I just submitted a GDB
patch for this, using PyImport_AppendInittab to define the built-in module at
startup. I'm not sure how I missed this originally; perhaps the documentation
was not as clear back
Paul Moore added the comment:
You could add the line
import sys; sys.path.insert(0, '')
to a .pth file. The documentation you pointed out states that lines starting
with "import" are executed...
--
___
Python track
Paul Ganssle <p.gans...@gmail.com> added the comment:
Ah, actually, my mistake, RFC 3339 most assuredly *does* require a UTC offset:
4.4. Unqualified Local Time
A number of devices currently connected to the Internet run their
internal clocks in local time and are unaware
Paul Ganssle <p.gans...@gmail.com> added the comment:
I think this is more a matter of misunderstanding the fact that ISO 8601 is a
larger and more complicated spec than people think. You'll note that the
original complaint also seems to think that a timezone is required (it is not).
Y
Change by paul j3 <ajipa...@gmail.com>:
--
nosy: +paul.j3
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue15327>
___
__
Paul Goins <gene...@vultaire.net> added the comment:
I don't know enough about those tests and how important they are considered.
My only concern would be with the increased risk of undetected breakage caused
by removing them from CI, but if people think the risk is negl
Paul Goins <gene...@vultaire.net> added the comment:
Also, to be clear, I understand what David is saying and don't disagree at all.
And if this really is Spectre related, it may be difficult to "go back" and
test a before case, so my last comment about "digging in"
Paul Goins <gene...@vultaire.net> added the comment:
If we consider this to be the new normal... What about increasing the timeout
to accomodate? From what I could gather, builds were running around 13 minutes
or so before the changes, so the timeout wasn't much above actual exe
Paul Czyzewski <tallp...@gmail.com> added the comment:
or, for a minimal doc change, change this sentence:
"For example, the relative weights [10, 5, 30, 5] are equivalent to the
cumulative weights [10, 15, 45, 50],"
to:
"For example, the relative call 'weights[10, 5,
Paul Czyzewski <tallp...@gmail.com> added the comment:
oops, if "k=400"
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33494>
___
__
Paul Czyzewski <tallp...@gmail.com> added the comment:
btw, this was my suggestion. Steven opened the issue on my behalf (I'm new).
1) Documentation change.
I would suggest that, to this paragraph:
"If neither weights nor cum_weights are specified, selections are made with
equal
Paul Ganssle <p.gans...@gmail.com> added the comment:
I don't really agree with these changes to the documentation.
The format that paulc identifies is actually an RFC 3339 datetime, which is a
subset of ISO 8601, to the extent that you consider the fact that "we're using
RFC 3339&
Paul Moore <p.f.mo...@gmail.com> added the comment:
Supplying cum_weights allows the code to use bisection to locate the correct
value to return. This is O(log n), and is significantly faster for large
populations than supplying weights (which need to be totalled for the
calcu
Paul Goins <gene...@vultaire.net> added the comment:
For what it's worth as a newbie here, I'll add my 2 cents. (This is partially
copied from my mail on python-dev.)
The one thing which I did notice between the last builds which passed and the
current builds is, under the "10 sl
paul j3 <ajipa...@gmail.com> added the comment:
I've attached a file that tries out the idea of building a custom `metavar` in
the `add_parser` method.
It subclasses argparse._SubParsersAction, and registers it with the parser. No
other modification to production code is re
paul j3 <ajipa...@gmail.com> added the comment:
Also
https://bugs.python.org/issue27303
[argparse] Unify options in help output
--
___
Python tracker <rep...@bugs.python.org>
<https://bugs.python
paul j3 <ajipa...@gmail.com> added the comment:
https://bugs.python.org/issue29626
Issue with spacing in argparse module while using help
This deals with a extra space that is produced when a blank metavar is used to
produce a more compact help line
-s , --service help text
My a
paul j3 <ajipa...@gmail.com> added the comment:
The usage formatter is brittle, especially the part that adds mutually
exclusive markings to the normal usage string. I don't think I've seen this
error before, but I'm not surprised.
A real fix requires a rewrite of the usage formatter,
paul j3 <ajipa...@gmail.com> added the comment:
This is normal behavior for argparse.
People have asked before for a more compact display. I remember suggesting
changes to the HelpFormatter subclass on Stackoverflow questions, and there's
probably one or more bug/issues addressing th
paul j3 <ajipa...@gmail.com> added the comment:
I've reviewed the comments and proposed patch, and still think that the custom
metavar is still the best fix.
subparses.metavar can be changed after subparsers has been created. The
programmer could, for example, write a simple helper fu
Paul Goins <paul.d.go...@intel.com> added the comment:
Good point, I forgot about WaitForMultipleObjectsEx; something like that seems
like it would be much simpler for the first 2 cases.
--
___
Python tracker <rep...@bugs.python.or
1101 - 1200 of 3183 matches
Mail list logo