Paul Ganssle added the comment:
I also commented on GH-26215 ( https://github.com/python/cpython/pull/26215 ),
but for posterity, I'll note a few things:
1. It seems that (and this may have changed since 2015), `_strptime._strptime`
now has a stage that (unconditionally?) constru
Paul Ganssle added the comment:
I do not want to dissuade you from figuring out how minithesis / hypothesis
works (far from it), but I'm wondering if the question of how shrinking works
is germane to the issue at hand, which is whether or not hypothesis /
property-based-testing is sui
Paul Ganssle added the comment:
New changeset c87b81dcb2c22b6d151da39a0f65d5db304f59a8 by Miss Islington (bot)
in branch '3.9':
bpo-43295: Fix error handling of datetime.strptime format string '%z'
(GH-24627) (#25695)
https://github.com/p
Paul Ganssle added the comment:
> I use hypothesis during development, but don't have a need for in the the
> standard library. By the time code lands there, we normally have a specific
> idea of what edge cases needs to be in the tests.
The suggestion I've made here is t
Paul Fisher added the comment:
Reading more into this, from section 5.2,1:
> A component is undefined if its associated delimiter does not appear in the
> URI reference
So you could say that since there is a '?', the query component is *defined*,
but *empty*. This would mea
Paul Ganssle added the comment:
Yeah, I knew this was slower and it's been on my long list to look at it (tied
to this is the fact that `datetime.today()` is basically just a slow version of
`datetime.now()`, in defiance of user expectations).
My inclination is that we shouldn
New submission from Paul Prescod :
from importlib import util
mathmodule = util.find_spec("math")
math1 = util.module_from_spec(mathmodule)
print(math1.pi)
=
$ python3.8 /tmp/foo.py
3.141592653589793
$ python3.9 /tmp/foo.py
Traceback (most recent call last):
File "/tm
Paul Moore added the comment:
I don't inderstand what "discrepancy" you mean here. The documentation you
quote explains the behaviour, and I don't see the problem.
If build is failing, why do you not think that is a bug in build? I can only
see one call to venv.EnvBui
Change by Paul Moore :
--
resolution: -> fixed
stage: patch review -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Paul Ganssle added the comment:
If we want to confine the behavior to just the repl, we could possibly have the
repl set an environment variable or something of that nature for interactive
sessions, so that `__repr__` of `exit` can tell the difference between being
invoked in a REPL and not
Paul Ganssle added the comment:
I'm +1 for Pablo's approach. That's approximately what I meant by "special-case
it in the REPL layer" anyway.
Are there any downsides to doing it this way? It seems tightly scoped a
Paul Ganssle added the comment:
> In fact, you're proposing to use exit as a keyword, but lying about it to the
> users. If it were really so important, then it _should_ be a keyword, and at
> least I'd know that I can't use it for my variables anymore. (It's
Paul Ganssle added the comment:
At this point I think we should probably start a thread on python-dev to see
how people feel about it. I'd be happy to author or co-author a PEP for this if
need be.
--
___
Python tracker
<https://bugs.py
Paul Moore added the comment:
It does for me:
>>> help(open("nul").writelines)
Help on built-in function writelines:
writelines(lines, /) method of _io.TextIOWrapper instance
Write a list of lines to stream.
Line separators are not added, so it is usual for ea
New submission from Paul Watson :
In the venv .\Scripts directory. the name 'Activate.ps1' does not conform to
the PowerShell prescribed Verb-Noun format.
How about using 'Initialize-Python.ps1' as the script name? Or, something else
that does conform to PowerS
Paul Ganssle added the comment:
Re-opening this because I think the discussion is not done and I don't see any
reason why this was rejected.
> Related 2005 python-dev discussion:
> https://mail.python.org/archives/list/python-...@python.org/thread/VNGY2DLML4QJUXE73JLVBIH5WFBZN
Change by Paul Ganssle :
--
stage: resolved ->
___
Python tracker
<https://bugs.python.org/issue44603>
___
___
Python-bugs-list mailing list
Unsubscrib
Paul Moore added the comment:
In "Apps and Features" on Windows 10, the application name is shown by default
but not the version. I have 3 different versions of Python installed on my PC
and if they all reported as "Python" it would be a lot harder to manage them
(I
Paul Moore added the comment:
See the attached screenshot. Only the app name is visible by default.
I see no benefit to the change and a definite usability degradation for people
like me with multiple Python versions.
--
Added file: https://bugs.python.org/file50152/Apps and
Paul Martin added the comment:
The difference between the two is the difference between your local time and
utc.
datetime.now(timezone.utc)
This returns the current time in utc and is timezone aware. So the timestamp
can figure out the seconds since epoch taking into account the timezone
Paul Moore added the comment:
It works as expected (the print statement in the "finally" clause is executed)
for me.
--
___
Python tracker
<https://bugs.python.o
paul j3 added the comment:
Joker
'type=bool' has been discussed in other issues. 'bool' is an existing python
function. Only 'bool("")' returns False. Write your own 'type' function if
you want to test for specific strings. It
paul j3 added the comment:
I've explored something similar in
https://bugs.python.org/issue11588
Add "necessarily inclusive" groups to argparse
There is a local variable in parser._parse_known_args
seen_non_default_actions
that's a set of the actions that have be
paul j3 added the comment:
More on the refactoring of error handling in _parse_known_args
https://bugs.python.org/issue29670#msg288990
This is in a issue wanting better handling of the pre-populated "required"
arguments,
https://bugs.python.org/issue29670
argparse: does n
Paul Ganssle added the comment:
Sorry you didn't receive a response to your security@ email, I guess my
response just went to the PSRT, not to you as well. I believe we determined
that this was an issue in importlib.resources generally, not specific to
zoneinfo.
I
Paul Ganssle added the comment:
I think this is a rounding issue. `time.time()` returns an epoch timestamp as a
float and at the current epoch time, floats are spaced ~500ns apart.
`datetime.datetime.now` does a floor division when rounding:
https://github.com/python/cpython/blob
New submission from Paul Menzel :
[copied from closed (out of date) issue https://bugs.python.org/issue25946]
Reproduced with Python 3.9.6.
./configure` both prints `checking for g++... no` and
WARNING:
By default, distutils will build C++ extension modules with &q
Paul Menzel added the comment:
I created https://bugs.python.org/issue44909.
--
nosy: +pmenzel
___
Python tracker
<https://bugs.python.org/issue25946>
___
___
paul j3 added the comment:
Another way to play with the defaults is to use argparse.SUPPRESS. With such a
default, the argument does not appear in the namespace, unless provided by the
user.
In [2]: p = argparse.ArgumentParser()
...: p.add_argument('--foo', default=argpars
Change by paul j3 :
--
nosy: +paul.j3
___
Python tracker
<https://bugs.python.org/issue44986>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by paul j3 :
--
nosy: +paul.j3
___
Python tracker
<https://bugs.python.org/issue44587>
___
___
Python-bugs-list mailing list
Unsubscribe:
paul j3 added the comment:
This is has been requested various times on StackOverflow, and possibly here
(I'd have to do a search).
The closest thing to making a compact action_invocation is to set the metavar
to '', and even thing we get a space, eg.
-f , --foo
paul j3 added the comment:
https://bugs.python.org/issue42980 argparse: GNU-style help formatter
https://bugs.python.org/issue33389 argparse redundant help string
https://bugs.python.org/issue29626
Issue with spacing in argparse module while using help
https://bugs.python.org/issue27303
paul j3 added the comment:
The idea of combining help features by defining a subclass that inherits from
other subclasses was endorsed by the original developer (we could dig up an old
bug/issue to prove that).
The provided subclasses all tweak a "private" method, often one tha
Paul Moore added the comment:
>From the documentation:
> upgrade indicates whether or not to upgrade an existing installation of an
> earlier version of pip to the bundled version.
Note the comment "to the bundled version". This command will not access the
internet
Change by Paul Moore :
--
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue45148>
___
___
Paul Moore added the comment:
> You are wrong. Windows lets me update pip via pip.
You have misinterpreted what you are seeing.
> Should i create new issue for this?
No, you should follow the correct process and use `python -m pip`, and not use
pip di
Paul Moore added the comment:
> I don't know technical details but i can successfully use this command: `pip
> install --upgrade pip`.
On Windows (and not under something like cygwin or msys, which have their own
rules)? Anyway, it's not that important, the recommended app
paul j3 added the comment:
In
https://stackoverflow.com/questions/69108632/unable-to-catch-exception-error-for-argparse
we found that `exit_on_error` does not work when the error occurs in a
subparser.
Unless someone wants to take time to get this right, I think this feature
should be
paul j3 added the comment:
In
https://stackoverflow.com/questions/69108632/unable-to-catch-exception-error-for-argparse
it looked like `exit_on_error` does not work when using subparsers. On on
further thought, I realized that it has to included in the definition of the
subparser. As
Change by paul j3 :
--
Removed message: https://bugs.python.org/msg401554
___
Python tracker
<https://bugs.python.org/issue41255>
___
___
Python-bugs-list mailin
New submission from Paul Broe :
Brand new build of Python 3.9.7 on RHEL 7. Placed in /usr/local/python3
Created new python environment
cd /usr/opt/oracle/
python3 -m venv py3-sphinx
source /usr/opt/oracle/py3-sphinx/bin/activate
Now verify that python is now linked to Python 3.
In this
Paul Broe added the comment:
Good Morning:
I was able to resolve the issue based on your assistance. I created this
topic at github.com
https://github.com/sphinx-doc/sphinx/issues/9669
Someone answered it and it was simple:
Thank you so much. That was it. I thought it was looking for a
Change by Paul Ganssle :
--
nosy: +p-ganssle
___
Python tracker
<https://bugs.python.org/issue45414>
___
___
Python-bugs-list mailing list
Unsubscribe:
Paul Ganssle added the comment:
This is a great bug report, but for anyone else who gets a bit lost in the
details, here's the core of the issue:
>>> p = Path("/1/2")
>>> q = Path("1/2")
>>> p.parents[-1] # This is correct
PosixPath(
paul rubin added the comment:
Oh wow, before_and_after will go into the itertools module per that patch? I
found this issue while looking for a way to this, but had written the following
implementation:
def span(pred, xs):
# split xs into two iterators a,b where a() is the prefix of xs
paul rubin added the comment:
Bah, the above doesn't work in the cases where the iterator is empty or
(different symptom) where the tail part is empty. Rather than posting a
corrected version (unless someone wants it) I'll just say not to use that code
fragment, but that the in
New submission from Paul Ganssle :
Right now the datetime documentation recommends using `dateutil.tz` for IANA
time zones, but we should update this to point to `zoneinfo`.
--
assignee: p-ganssle
components: Documentation
messages: 404207
nosy: p-ganssle
priority: low
severity
Change by Paul Ganssle :
--
keywords: +patch
pull_requests: +27309
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/29038
___
Python tracker
<https://bugs.python.org/issu
Paul Moore added the comment:
That's probably because you're using Python 3.10 (assuming the "version" tag
you added is correct) and those libraries haven't released Windows binaries for
Python 3.10 yet.
You should wait for binaries to be released, and check with th
paul j3 added the comment:
Adding `newline` to `FileType` requires modifying both the `__init__` and
`__call__` methods. That's nearly the whole class. I'd copy and edit, and
forget about subclassing.
--
___
Python track
Change by paul j3 :
--
nosy: +paul.j3
___
Python tracker
<https://bugs.python.org/issue45587>
___
___
Python-bugs-list mailing list
Unsubscribe:
paul j3 added the comment:
`add_argument` also returns a Action subclass object. All of those subclasses
are "private". While that return reference is usually ignored, sometimes it is
useful to it, assigning it to a variable or list. The documentation could be
clearer about
paul j3 added the comment:
The usage formatting is fragile, with many associated bug reports. Until
someone does a major rewrite, it is best to avoid special characters,
especially `()` and `[]` in the `dest` or `metavar`.
Usage uses () to encolde mutually_exclusive_groups and [] to mark
paul j3 added the comment:
Are you expecting the subcommand help to show the 'help' line that the main
help shows?
subparsers.add_parser('a', help='a help')
add_parser takes all of the parameters that `ArgumentParser` takes, including
description and epilo
paul j3 added the comment:
As a default option flags can be abbreviated (unless there's a conflict).
Recent version have a allow_abbrev parameter that lets you turn this off.
--
nosy: +paul.j3
___
Python tracker
<https://bugs.py
Change by paul j3 :
--
nosy: +paul.j3
___
Python tracker
<https://bugs.python.org/issue45235>
___
___
Python-bugs-list mailing list
Unsubscribe:
paul j3 added the comment:
I haven't studied or tested this change, but it looks like a partial retraction
of
https://bugs.python.org/issue9351
argparse set_defaults on subcommands should override top level set_defaults
Originally the main namespace was passed to the subparser. S
paul j3 added the comment:
I just downloaded this `argparse.py`.
This change makes it impossible to use a subparser argument if it is defined in
the user provided namespace, or by the main parser. It blocks not only
subparser default, but also user input.
It has reverted the 9351 patch
paul j3 added the comment:
parser = argparse.ArgumentParser()
sub = parser.add_subparsers()
example_subparser = sub.add_parser("example")
example_subparser.add_argument("--flag", default=10)
print(parser.parse_args(["example","--flag=15"
paul j3 added the comment:
A _SubParsersAction is private to the extent that users should not attempt to
create it directly, and thus don't need to know the details - beyond what's
documented:
"The add_subparsers() method is normally called with no arguments and returns a
Change by paul j3 :
--
stage: resolved -> test needed
status: closed -> pending
___
Python tracker
<https://bugs.python.org/issue45235>
___
___
Python-bugs-
Change by paul j3 :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue45504>
___
___
Python-bugs-list
paul j3 added the comment:
Артём Иконников, developers and experienced users are familiar with other
programs, such as 'svn' which is used as an example
svn checkout, svn update, and svn commit
Also the use of '--foo' as flagged/optional(s) argument is so familiar to
New submission from paul j3 :
https://bugs.python.org/issue45235
argparse does not preserve namespace with subparser defaults
was passed and put into the latest release with rather obvious buggy behavior.
This means that the unittest file does not adequately test for overlapping
'des
paul j3 added the comment:
I should study previous posts in more detail, but here are some thoughts on
correctly handling user namespace.
At the start of `parse_known_args`, there's a
if namespace is None:
namespace = Namespace()
We need to hang on to a copy of
paul j3 added the comment:
A new patch, https://bugs.python.org/issue45235 has clobbered this patch.
It has also exposed the inadequate unittesting for the case(s) where the 'dest'
of main namespace, subparser namespace, user provided namespa
paul j3 added the comment:
There was a bug/issue that addressed problems with nested
mutually_exclusive_groups. It should be easy to find.
The problem is that the usage formatter is brittle, building a string and then
striping out "unnecessary" characters. I assume the fix h
paul j3 added the comment:
This is too big of an example for this board; I think it should have been asked
on StackOverFlow. Or maybe trimmed do to a more compact example.
But in any case, this is normal behavior for argparse. Type checking, here
'int', is done after the
paul j3 added the comment:
Use of 'prefix_chars' as a argument_group parameter is not documented, nor
intended.
If it does appear to work in the help formatting, it is probably the result of
inheritance, since both ArgumentParser and Argument_group subclass a
_Actions_Conta
paul j3 added the comment:
https://bugs.python.org/issue29553
Argparser does not display closing parentheses in nested mutex groups
supposedly fixed the parentheses for nested groups. You can read its
discussion and patches to see why it does not handle your case.
I don't see any exa
paul j3 added the comment:
prefix_chars is a parameter of the parent _ActionsContainer
class _ActionsContainer(object):
def __init__(self,
description,
prefix_chars,
argument_default,
conflict_handler):
super
paul j3 added the comment:
https://bugs.python.org/issue9338
argparse optionals with nargs='?', '*' or '+' can't be followed by positionals
As you can see this is an old issue, but still too big for a quick fix.
As a general rule, don't use `nargs`
paul j3 added the comment:
Put the required positional first
$ myapp myfile -s
or one of the store_true arguments
$ myapp -s -j myfile
I think
$ myapp -s -- myfile
will work as well, but that needs to be tested.
The '-s' has to be followed by something won't be
Paul Moore added the comment:
Well, we don't support doing that - so I'm not sure what you want beyond the
statement "it's not supported". If it works for you, then by all means use it,
but you'll be on your own for any issues you encounter unless you ca
Paul Ganssle added the comment:
I think this is mostly a duplicate of bpo-41260, which has an open PR on it. I
think that got lost in the shuffle, I'm sad we didn't fix it in Python 3.10. I
think we should migrate all of these signatures that differ to whichever one
the C impleme
Paul Ganssle added the comment:
Updating this issue to cover the problem in date, time and datetime.
--
title: datetime: strftime method takes different keyword argument: fmt (pure)
or format (C) -> datetime, date and time: strftime method takes different
keyword argument: fmt (p
Paul Moore added the comment:
I tend to agree with Steven and David here. You define __getattribute__ and so
that's the behaviour you get when an attribute of the class is requested
(whether by the system or by your code). The documentation (here:
https://docs.python.org/3/refe
paul j3 added the comment:
Yes you can set the default to be any object, such as an evaluated string. If
it isn't a string it won't be passed through 'type'.
The purpose of the delayed evaluation that I described is to avoid unnecessary
evaluations. The worse c
Change by paul j3 :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue38736>
___
___
Python-bugs-list
Paul Ganssle added the comment:
I do not think this is a bug in pytz, but if it's a bug in Python it's one in
reporting what the error is.
The issue is that the time zone offset for "rules-based zones" like
America/Denver (i.e. most time zones) is *undefined* for bare
Change by paul j3 :
--
nosy: +paul.j3
___
Python tracker
<https://bugs.python.org/issue38821>
___
___
Python-bugs-list mailing list
Unsubscribe:
paul j3 added the comment:
It doesn't have to be a special class. It can be a `argparse.Namespace` object.
If the preexisting namespace has an attribute set, the action default will not
over write it.
In [85]: parser = argparse.ArgumentParser()
...: parser.add_argument(&
Paul Moore added the comment:
PyPA member here - if this PR is defining new compatibility tags, I would have
expected it to need discussion as a revision to PEP 425, much like the
manylinux efforts did. (It may actually be a closer parallel with MacOS, which
didn't have a tagging PEP
Paul Moore added the comment:
What complicates the issue for AIX (and reminds me very strongly of the MacOS
and manylinux situations, both of which were defined after the original tag
PEP, and so contain additional insights) is the business of certain tags being
compatible across multiple
Paul Moore added the comment:
Thanks for the clarification, Nick. Yes, I agree that the basic "this is the
tag that matches this precise CPython installation" is not the difficult part
of the problem here, and if that is all that this issue is targeting, there
should be no maj
Paul Moore added the comment:
The behaviour in this area is different between 3.7.0, 3.7.2, and 3.7.3 (at
least). I have reproduced the issue with 3.7.3. Steve Dower made changes to the
way the python executable works in venvs in the point releases of 3.7 - see
https://github.com/pypa
Paul Moore added the comment:
Yes, it does.
I think we'd need input from Steve Dower here, as these changes were made (I
believe) in support of the Windows Store build of Python, so any changes would
need to be considered in the light of how they would affect that. I do,
however, con
Paul Moore added the comment:
I presume there's also the option of setting up the environment (or however
it's done now - I know the details changed as the feature was developed) so
that the "base" python.exe pretends to be the venv one, exactly as the wrapper
does.
Ho
Paul Ganssle added the comment:
For the future, we generally tend to keep distutils pretty "frozen", only
making minor changes or the changes needed to build Python itself. Instead we
generally make changes in setuptools, which for the moment monkey-patches
distutils (and
Paul Moore added the comment:
> replacement platform_tag, not compatibility tag.
Ah, I see, sorry. In that case, this should be fine, it's purely a CPython
question. There's obviously a follow-on discussion about how that platform tag
is *incorporated* into the compatibility
paul j3 added the comment:
This related to an old issue
https://bugs.python.org/issue9694
argparse required arguments displayed under "optional arguments"
argparse defines two initial argument groups, titled 'positional arguments' and
'optional arguments'. Al
Paul Moore added the comment:
Can you provide a minimal, self-contained, example of a program that
demonstrates this behaviour in 3.8, but works in 3.7. It's not really possible
to determine what the issue might be without a means of reproducing the problem.
--
components: +Tk
Change by Paul Moore :
--
nosy: +gpolo, serhiy.storchaka
___
Python tracker
<https://bugs.python.org/issue38974>
___
___
Python-bugs-list mailing list
Unsub
Paul Moore added the comment:
See PEP 486
(https://www.youtube.com/watch?v=Lmq13nrEFaM&list=PLuE3ABw6vYeR0gcPT6uj25ZZhmSP9vRB2&index=28&t=0s).
This is intended behaviour, as it is assumed that explicitly specifying a
Python version means that the user had a specific Python in
Change by Paul Moore :
--
Removed message: https://bugs.python.org/msg358060
___
Python tracker
<https://bugs.python.org/issue38999>
___
___
Python-bugs-list m
Paul Moore added the comment:
See PEP 486 (https://www.python.org/dev/peps/pep-0486/). This is intended
behaviour, as it is assumed that explicitly specifying a Python version means
that the user had a specific Python interpreter in mind.
There are also technical issues - if the shebang
Paul Moore added the comment:
Most items in the Scripts directory can be run using the `-m` flag to Python,
so you can use something like `py -m pip` to run pip without needing the
Scripts directory in PATH.
If an individual project like PyQt doesn't support -m, it's relativel
Paul Moore added the comment:
> sys.path = [
>'C:\\Developing\\Python\\python38.zip',
>'C:\\Developing\\Python\\python-3.8.0.amd64\\Lib\\',
>'C:\\Developing\\Python\\python-3.8.0.amd64\\Lib\\lib-tk',
>'C:\\Developing\\Python\
Paul Moore added the comment:
Can you also confirm that the installation of Python was done with the standard
Python installer from the python.org website, and is not another distribution
(such as Anaconda)?
--
___
Python tracker
<ht
501 - 600 of 3008 matches
Mail list logo