paul j3 added the comment:
But you can replace the simple 'lambda' with a function that takes the max with
'columns'. In other words, include:
width = _shutil.get_terminal_size().columns
width -= 2
width = min(max_text_width, width)
The only thing
Paul Ganssle added the comment:
I don't think adding a default_year parameter is the right solution here.
The actual problem is that `time.strptime`, and by extension
`datetime.strptime` has a strange and confusing interface. What should happen
is either that `year` is set to None or some
paul j3 added the comment:
https://bugs.python.org/issue13041
is (I think) the latest issue/patch to deal with the help width.
I don't like the idea of adding more parameters to the `ArgumentParser` class.
It's too complicated already.
There are a couple of ways that a user can do
Change by Paul Ganssle :
--
nosy: -p-ganssle
___
Python tracker
<https://bugs.python.org/issue39763>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Paul Ganssle :
>From a report on the dateutil tracker today, I found that `time.timezone` and
>`time.altzone` are not accurate in Ireland (at least on Linux, not tested on
>other platforms): https://github.com/dateutil/dateutil/issues/1009
Europe/Dublin in the m
New submission from Paul Marquess :
Consider this code (based on code from an issue on StackOverflow)
import zipfile
import os
allFilesToZip = ["/tmp/tom"]
with zipfile.ZipFile(allZipPath, 'w') as allZip:
for f in allFilesToZip:
allZip.write(f, compress_type=zipfile.ZI
Paul Moore added the comment:
You've provided links to your branches, but not to the specific text you're
proposing to add. Can you link to a diff or something that shows what you've
added more precisely?
--
___
Python tracker
<ht
Paul Ganssle added the comment:
So this bug is asking for two things:
1. An official accessor for the `tzinfo` component of an existing datetime,
which I think is very reasonable in light of the fact that there are official
accessors for all the other components of a datetime.
2
New submission from Paul Ganssle :
The entire public interface documented for the datetime C API is various C
macros (see: https://docs.python.org/3/c-api/datetime.html) which are wrappers
around function calls to the PyDateTimeAPI / PyDatetime_CAPI struct, but the
struct itself
Paul Moore added the comment:
> In short -- I understand that this is a complex issue, but making an absolute
> path is a pretty common use case, and we've had os.path.abspath() for
> decades, so there should be one obvious way to do it, and it should be easily
> disco
Paul Ganssle added the comment:
Serhiy: I think at least a test for this particular corner case should be
added, so that no implementations of `isinstance` that use the CPython test
suite hit an infinite recursion in that event, I guess?
Though I think it's maybe an open question as to what
Paul Ganssle added the comment:
Per my reasoning in the discourse thread, I disagree with this move. I think
that this should be handled in setuptools, which is where we tend to handle
breaking changes or even enhancements to distutils.
If we do this in setuptools, we'll get a backport
paul j3 added the comment:
https://bugs.python.org/issue9694
is the original issue about the titles of the base argument groups.
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bug
paul j3 added the comment:
I don't think the SO question is relevant. It's about changing the order of
Actions in the Help and/or usage.
Here it's a question of whether to sort the `argparse.Namespace` display. I
think it's been adequately discussed in the recent bug/issues
paul j3 added the comment:
A mutually_exclusive_group is not an argument_group. It affects parsing and
the usage, but does nothing in the help lines.
A mutually_exclusive_group may be nested in an argument_group if you want
another group title.
g1 = parser.add_argument_group('My
paul j3 added the comment:
The issue of testing a script that uses argparse has come up on StackOverFlow a
number of times.
As noted the unittesting framework(s) often use their own parsers (not
necessarily argparse). That means they are looking at the sys.argv
commandline
paul j3 added the comment:
This is a complicated issue that needs a lot of thought and testing before we
make any changes.
While all Actions have the 'required' attribute, the programmer can only set it
for optionals. _get_positional_kwargs() will raise an error if the programmer
tries
Paul Sokolovsky added the comment:
> We may be possible to replace bytecode from `STORE_GLOBAL _cnt; LOAD_GLOBAL
> _cnt` into `DUP_TOP; STORE_GLOBAL _cnt`.
Sounds good, and that's why I personally care about the "STORE" case, and the
patch I submit touches only it, which w
Paul Sokolovsky added the comment:
Absolutely should be able to optimize namespace access. The fact that namespace
is a dict is an implementation detail, it's still inefficient even with all
those version counters and inline caches. Ironically, to let people prototype
better, more efficient
Paul Sokolovsky added the comment:
> exec() function is currently quite clear
A recent case: https://bugs.python.org/issue38316, co_stacksize was quite clear
what it is. Turned out, a bug in the documentation (likely, just someone forgot
to update it to the actual code). That's just
Paul Sokolovsky added the comment:
> Namespace performances are really critical for overall Python performances.
Yeah, that's why I'd like for myself and other people to make it easy to
explore the behavior of namespace lookups, to see how to optimize them.
> You're free to fork
Paul Sokolovsky added the comment:
> Paul: you're are in front of 3 core developers who are rejecting your feature
> request.
But no, it's not my feature request. There were 2 tickets by at least 2 people.
I just saw my case to be similar to cases of those people, so instead of
cr
Paul Sokolovsky added the comment:
> you ask to modify Python so you can pass dict subclasses as namespaces and
> expect CPython to respect the mapping protocol
But no, per your own account, you made noticeable, though not complete, code
changes in that direction. The only thing I'm
Paul Sokolovsky added the comment:
Ok, so the patch for my usecase (STORE_GLOBAL) is vividly trivial, so to go
thru the full circle, I posted it: https://github.com/python/cpython/pull/18033
.
--
___
Python tracker
<https://bugs.python.
Change by Paul Sokolovsky :
--
pull_requests: +17429
pull_request: https://github.com/python/cpython/pull/18033
___
Python tracker
<https://bugs.python.org/issue36
Paul Sokolovsky added the comment:
s/only our own usecase/only your own usecase/ (missing "y" typo)
--
___
Python tracker
<https://bugs.python.o
Paul Sokolovsky added the comment:
> Later, I closed my pysandbox beause it was "broken by design":
https://lwn.net/Articles/574215/
Thanks for the link, insightful. Still unclear, by design of what it's broken
;-).
> Paul Sokolovsky wrote in bpo-36220 than his idea is a
Paul Ollis added the comment:
> I thought that if this raises a (normal) exception, it always means that it
> did not have overtaken the `fd`, i.e. never results in an unreferenced file
> object which has taken ownership of `fd`.
The current CPython implementation does not guar
Paul Ollis added the comment:
I think it is worth pointing out that the semantics of
f = ``open(fd, closefd=True)``
are broken (IMHO) because an exception can result in an unreferenced file
object that has taken over reponsibility for closing the fd, but it can
also fail without
Paul Ganssle added the comment:
> Yes, but not within the same format. If someone were to choose the format
> '2014-04-10T24:00:00', they would have a reasonable expectation that there is
> only one unique string that corresponds with that datetime
That's a particularly bad example
Paul Ganssle added the comment:
I don't love the inconsistency, but can you elaborate on the actual *danger*
posed by this? What security vulnerabilities involve parsing a datetime using a
non-ascii digit?
The reason that `fromisoformat` doesn't accept non-ASCII digits is actually
because
Paul Moore added the comment:
For me, I headed straight for "Sharing state between processes" and the "Shared
memory" object. That's probably because I was reviewing someone else's code,
rather than writing my own, but nevertheless when coding I do tend to dive
stra
Paul Moore added the comment:
Agreed it's not a bug, but I will say it took me a while to work out *why* it's
not a bug (namely, that even though the OP is using shared memory values, the
code relies on fork semantics to share the two Value objects that *reference*
the shared memory
Paul Ganssle added the comment:
> Oh, also, if y'all are fine with binding to Rust (through a C ABI) I'd love
> to help y'all use unicode-segmentation, which is much less work that pulling
> in ICU. Otherwise if y'all have implementation questions I can answer them.
> This s
Paul Sokolovsky added the comment:
> I agree with Terry, the moment you pass a dict subclass to exec you are out
> of contract. If any, we may need to sanitize the input to exec, although I
> don't think is worth paying the performance price for that.
exec() params are alread
Paul Sokolovsky added the comment:
> The doc for exec says globals "must be a dictionary (and not a subclass of
> dictionary)"
Docs are full of mistakes and outdated information.
Fixing STORE_GLOBAL case from https://bugs.python.org/issue36220#msg359046
would be triv
Paul Sokolovsky added the comment:
Some smart maintainer closed https://bugs.python.org/issue36220 as a duplicate
of this one. That ticket might have more details of the underlying issues.
--
nosy: +pfalcon
___
Python tracker
<ht
paul j3 added the comment:
The rejected boolean type proposal:
https://bugs.python.org/issue37564
--
___
Python tracker
<https://bugs.python.org/issue39
paul j3 added the comment:
Despite the name, the 'type' parameter specifies a function, not a Python
class.
The only string that produces False is the empty one: bool(''). So 'type=bool'
is valid Python, even if it isn't useful.
With `nargs='+'` there's no problem with providing strings
Paul Sokolovsky added the comment:
> I wanted to write a sandbox for Python.
Sandbox indeed, it is.
class NS(dict):
def __setitem__(self, k, v):
if not isinstance(v, type(lambda: 0)):
raise RuntimeError("Global variables considered harmful")
globals
Change by Paul Sokolovsky :
--
nosy: +pfalcon
title: LOAD_NAME and LOAD_GLOBAL handle dict subclasses for globals()
differently -> LOAD_NAME and LOAD_GLOBAL, STORE_GLOBAL handle dict subclasses
for globals() differently
___
Python tracker
<
Change by Paul Ganssle :
--
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.6
___
Python tracker
<https://bugs.python.org/issue13305>
___
___
Python-bug
Paul Ganssle added the comment:
This is a duplicate of issue 13305.
Right now we have some shims around `strftime` to improve consistency in some
situations and for other reasons, but mostly we just call the libc version.
There is an open issue from 2008 (#3173) to ship our own
paul j3 added the comment:
This patch changes the super class, _AttributeHolder. ArgumentParser and
Actions also inherit from this, though they have their own _get_kwargs methods,
and so aren't affected by the sort and its removal.
I just had occasion on stackoverflow to discuss the order
Change by paul j3 :
--
nosy: +paul.j3
___
Python tracker
<https://bugs.python.org/issue39076>
___
___
Python-bugs-list mailing list
Unsubscribe:
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
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\\python-3.8.0.amd64\\DLLs\\',
>
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 relatively easy
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
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.youtube.com/watch?v=Lmq13nrEFaM=PLuE3ABw6vYeR0gcPT6uj25ZZhmSP9vRB2=28=0s).
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
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:
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: +Tkinter
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'. Alternatives have been
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 t
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:
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.
However, tha
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, consider
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:
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:
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:
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 - I'm
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('--foo
Change by paul j3 :
--
nosy: +paul.j3
___
Python tracker
<https://bugs.python.org/issue38821>
___
___
Python-bugs-list mailing list
Unsubscribe:
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 time
Change by paul j3 :
--
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue38736>
___
___
Python-bugs-list
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 case would be a write
paul j3 added the comment:
get_default just returns the default attribute as it is stored in the Action.
Defaults are stored as given.
During parsing the Action's default is placed in the args namespace at the
start. At the end, it checks if the value in the namespace is a string
New submission from Paul Anton Letnes :
Python 3.7 and 3.8 installed from the Windows Store do not start under git
bash. Rather, they give some variation of this error message:
bash: /c/Users/pa/AppData/Local/Microsoft/WindowsApps/python: Permission denied
However, the permissions are rwxr
paul j3 added the comment:
With one exception, groups are not designed or intended to be nested. But by
inheritance (from _ActionsContainer) nesting isn't blocked nor does it raise
any errors.
As you surmise, an ArgumentGroup, is used only for grouping the help lines. By
default
paul j3 added the comment:
A couple of quick observations:
- this is one of the first patches that I worked on, so the details aren't
fresh in my mind. A glance at my latest patch show that this isn't a trivial
change.
- nargs changes affect the input handling, the parsing, help
Stephen Paul Chappell added the comment:
@rhettinger: The turtle demo is easily accessible through the menus via Help >
Turtle Demo.
It is nice to see there are others interested in IDLE's improvement. :-)
--
___
Python tracker
<
Paul Ganssle added the comment:
Ah, my mistake. The examples all use `datetime.fromtimestamp`, so I didn't
notice that it was failing only on the `timestamp` side. Re-opening, thanks!
--
resolution: duplicate ->
status: closed -> open
superseder: [Windows] datetime.fromtimes
Paul Ganssle added the comment:
This has been coming up in a few different contexts lately, so I think it would
be really good if we could get some sort of fix for it.
One option is to implement our own versions of these APIs for use in Windows,
but a thought occurred to me recently: we
Paul Ganssle added the comment:
Changing the superceder here as I think #36439 matches better than #37527.
--
nosy: +p-ganssle
resolution: duplicate ->
status: closed -> open
superseder: Timestamp conversion on windows fails with timestamps close to
EPOCH -> Incons
Paul Ganssle added the comment:
This indeed seems to be a duplicate of 29097, which is fixed in Python 3.7, so
we can close this bug. Thank you for your report Dschoni, and thank you for
finding the duplicate Ma Lin!
--
resolution: -> duplicate
stage: -> resolved
status
Stephen Paul Chappell added the comment:
Zero: "not to have them added as text as is usual in a terminal window"
taleinat: "removing prompts from the shell window's text widget"
Zero: "print the values of ps1 and ps2 in the proposed ShellIO subclass&quo
Paul Martin added the comment:
Good points. I made a mistake in run
Should be:
async def run(self, func, *args, **kwargs):
call = functools.partial(func, *args, **kwargs)
return await self._loop.run_in_executor(self._executor, call)
Also in this case run awaits
Paul Martin added the comment:
Run method should be:
async def run(self, func, *args, **kwargs):
call = functools.partial(func, *args, **kwargs)
return await self._loop.run_in_executor(None, call)
--
___
Python tracker
<ht
Paul Martin added the comment:
I don't think changing the default executor is a good approach. What happens,
if two or more thread pools are running at the same time? In that case they
will use the same default executor anyway, so creating a new executor each time
seems like a waste
paul j3 added the comment:
Just clarify how the code currently works. `subparsers` is a positional Action
of subclass _SubParsersAction. It has a nargs='+...', requiring at least one
string, and taking all remaining strings. Its __call__ has the standard
signature. So everything that's
Stephen Paul Chappell added the comment:
Maybe my impression has been false this whole time, but the Python interactive
interpreter seems to be very similar to the IDLE shell window. My question is,
"Why not make them even more so?" Having IDLE react to sys.ps1 and sys.ps2
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue6188>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue21957>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue24185>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue21402>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue18601>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue21537>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue18558>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue31848>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue31476>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Stephen Paul Chappell :
--
nosy: -Zero
___
Python tracker
<https://bugs.python.org/issue7676>
___
___
Python-bugs-list mailing list
Unsubscribe:
Stephen Paul Chappell added the comment:
The documentation for sys.ps1 and sys.ps2 states that they "are only defined if
the interpreter is in interactive mode." Since the IDLE shell is meant to be
interactive (and to reduce the differences between the shell and running Python
Stephen Paul Chappell added the comment:
When I start IDLE and the shell window appears, my first task is to press "Alt
+ T" to change from using tabs to spaces and then "Alt + U" to change from
using 8 spaces to 4. This allows code pasted from the shell into an editor
New submission from Stephen Paul Chappell :
In the latest Python 3.8.0 installation when running IDLE on Windows, pressing
"Alt + T" generates the following error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Program Files\Pytho
paul j3 added the comment:
Just today on SO someone found a similar bug in the help format with metavars,
that involved an unpacking the expected only one value, but got 2.
https://stackoverflow.com/questions/58541460/tuple-metavar-value-for-positional-argument-with-nargs-1
This had
Change by paul j3 :
--
nosy: +paul.j3
___
Python tracker
<https://bugs.python.org/issue38438>
___
___
Python-bugs-list mailing list
Unsubscribe:
paul j3 added the comment:
So the error occurs in HelpFormatter._format_action when 'help_lines' is an
empty list:
if action.help:
help_text = self._expand_help(action)
help_lines = self._split_lines(help_text, help_width)
>> parts.
Change by Paul Martin :
--
pull_requests: +16408
pull_request: https://github.com/python/cpython/pull/16863
___
Python tracker
<https://bugs.python.org/issue38
Paul Moore added the comment:
Can you give an example of a script that fails? If you try to print (or
otherwise use the standard IO streams) pythonw will fail, because there are no
stdio streams for a GUI executable - and the traceback, which goes to stderr by
default, will be lost
501 - 600 of 3183 matches
Mail list logo