Change by Anthony Sottile :
--
nosy: -Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue45847>
___
___
Python-bugs-list mailing list
Unsubscribe:
Anthony Sottile added the comment:
I could, but it's very unlikely to get fixed given I believe 18.04 is in
security-only fixes and backporting a pkg-config file seems unlikely
this worked two days ago before this patch
--
___
Python tracker
Anthony Sottile added the comment:
the `tk-dev` package on ubuntu bionic does not ship with a `pkg-config` file
for tk so it does not build properly there:
```
root@f0dd06a3e87c:/cpython# dpkg -L tk8.6-dev | grep pc
root@f0dd06a3e87c:/cpython#
```
(a note: bionic reaches end of life
Anthony Sottile added the comment:
this appears to break the tkinter extension for ubuntu bionic (18.04) -- I'm
not entirely sure on the correct fix here but I get the following from trying
to build there:
2022-04-02T15:52:08.0910452Z Python build finished successfully!
2022-04-02T15:52
Anthony Sottile added the comment:
would it be possible to expose `parse_template` -- or at least some way to
validate that a regex replacement string is correct prior to executing the
replacement?
I'm currently using that for my text editor:
https://github.com/asottile/babi/blob
Change by anthony shaw :
--
versions: +Python 3.10, Python 3.11
___
Python tracker
<https://bugs.python.org/issue46707>
___
___
Python-bugs-list mailin
New submission from anthony shaw :
Providing an (invalid) input to the parser causes an exponentially-slow DoS to
the Python executable in 3.10.
e.g.
python3.10 -c "{:"
takes ~2 seconds
python3.10 -c ":"
takes ~22 seco
New submission from anthony shaw :
In tokenizer.c, the translate_newlines() function does a `strlen()` on the
input string, if the string is not null-terminated, e.g.
'\xbe' this leads to a heap-buffer-overflow. The overflow is not exploitable,
but if there are further changes to the parser
Anthony Sottile added the comment:
3.7.2 has another example where OrderedDict was added to typing
I don't have any personal investment in this particular change but I've had
quite a few unhappy consumers of libraries due to instability in typing apis
between patch versions in the past (heh
Anthony Sottile added the comment:
to me this is the same as the Union[Pattern] / Union[Match] "fixes" that landed
in 3.5.3 -- and the pain caused by using that and having CI pass (because of
modern 3.5.x) but having spurious bug reports from users stuck on 3.5.2
or in 3.6.1 when
Anthony Sottile added the comment:
should this behaviour change be backported? it potentially creates an annoying
edgecase where code seemingly works unless you use an older patch version
since this isn't a bugfix I wouldn't expect this to land in 3.9 and 3.10
--
nosy: +Anthony
anthony shaw added the comment:
After some experimentation, this can be done if you enable ASAN in all projects
except python3dll.vcxproj
I think it would make sense (if this were supported) to have a flag in
build.bat like there is for pgo
`build.bat --asan
New submission from anthony shaw :
I'd like to compile my C-extensions with ASAN for testing in Windows, but they
cannot be loaded as the host python.exe process needs to be compiled with ASAN.
https://docs.microsoft.com/en-us/cpp/sanitizers/asan?view=msvc-170#ide-msbuild
The EnableASAN
Anthony Sottile added the comment:
looks like this was removed in 3.11 -- wondering if it's still worth correcting
the deprecation warning location
--
versions: +Python 3.10 -Python 3.11
___
Python tracker
<https://bugs.python.org/issue44
Anthony Sottile added the comment:
rebased this onto 3.11
--
versions: +Python 3.11 -Python 3.9
___
Python tracker
<https://bugs.python.org/issue39214>
___
___
Anthony Sottile added the comment:
I'm seeing some weird breakage in the deadsnakes builds, presumably due to this
change:
```
...
2021-10-27T08:55:21.9485959Z x86_64-linux-gnu-gcc -pthread -Wno-unused-result
-Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -fdebug-prefix-map=/tmp/code
Anthony Sottile added the comment:
alignment was the only one I found which was applicable and didn't work
`!s` "works" but it's kind of a hack (of course I want string formatting, I'm
making a string!) -- then I would want to write `!s` everywhere which is
cumbersom
New submission from Anthony Sottile :
currently this works correctly:
```
>>> '%8s %8s' % (None, 1)
'None1'
```
but conversion to f-string fails:
```
>>> f'{None:>8} {1:>8}'
Traceback (most recent call last):
File "", line 1, in
TypeError
Anthony Sottile added the comment:
this maybe shouldn't have been backported to 3.8.x as the change in compiler
flags appears to break pyc files in subtle ways:
https://stackoverflow.com/q/68910329/812183
--
nosy: +Anthony Sottile
___
Python
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
nosy_count: 19.0 -> 20.0
pull_requests: +26032
pull_request: https://github.com/python/cpython/pull/27516
___
Python tracker
<https://bugs.python.org/issu
anthony shaw added the comment:
Thanks! I didn't realise it applied the negative operator instead of loading
the constant value.
--
___
Python tracker
<https://bugs.python.org/issue44
Change by anthony shaw :
--
title: Const unfolding in parser with negative numbers doesn't match float/int
behaviour -> Const folding in parser with negative numbers doesn't match
float/int behaviour
___
Python tracker
<https://bugs.pyth
New submission from anthony shaw :
Powers with negative bases do not observe the same rules that
float_pow/long_pow do when it comes to returning negative results/
Example:
> -2 ** 2
-4
>>> x = -2
>>> y = 2
>>> x ** y
4
>>> -2. ** 2.
-4.0
>&g
New submission from Anthony Sottile :
this is a small proposal to add a new function to the functools module which
provides better profiling-compatible `@functools.wraps(...)`
the rationale comes from https://github.com/Yelp/named_decorator (which is dead
/ abandoned)
the tl;dr from
Anthony Sottile added the comment:
here is a minimal reproduction:
```python
def iterboom():
raise AssertionError
yield 1
next(1 for x in iterboom())
```
python 3.9:
```
$ python3.9 t.py
Traceback (most recent call last):
File "/tmp/rinohtype/t.py", line 5, in
ne
New submission from Anthony Sottile :
installed from git:
```
$ git remote -v
origin https://github.com/brechtm/rinohtype.git (fetch)
origin https://github.com/brechtm/rinohtype.git (push)
$ git rev-parse HEAD
4054539bae53eaddd10291c8429a1a32aeeb4786
```
working in 3.10 b2:
```console
Anthony Sottile added the comment:
here's the traceback pytest is trying to display and crashing:
```
Traceback (most recent call last):
File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/runner.py",
line 311, in from_call
result: Optional[TResult] = func()
Anthony Sottile added the comment:
this appears to have regressed in 3.10 as well according to some reports on
pytest: https://github.com/pytest-dev/pytest/pull/8227#issuecomment-864327090
--
nosy: +Anthony Sottile, pablogsal
versions: +Python 3.10
Anthony Sottile added the comment:
they are directly coupled which is why I commented here
the api redesign forces O(N) lookups and O(N) constructions which directly
impact performance causing the regression
--
resolution: fixed ->
status: closed ->
Anthony Sottile added the comment:
here's the performance regressions, they affect any callers of
`distributions()` and are even worse on callers of the new apis.
a call to distributions() is about 3x slower than in 3.9
here is the setup I am using:
virtualenv venv39 -ppython3.9
venv39/bin
Change by Anthony Sottile :
--
components: +Library (Lib)
type: -> behavior
___
Python tracker
<https://bugs.python.org/issue44295>
___
___
Python-bugs-lis
Anthony Sottile added the comment:
*terry.reedy oops typo!
--
___
Python tracker
<https://bugs.python.org/issue44307>
___
___
Python-bugs-list mailing list
Unsub
Anthony Sottile added the comment:
@terry.reddy -- I believe your title change makes this more difficult to
understand
--
___
Python tracker
<https://bugs.python.org/issue44
New submission from Anthony Sottile :
```console
$ python3.10 -m timeit -s 'from datetime import datetime'
'datetime.now().date()'
50 loops, best of 5: 708 nsec per loop
$ python3.10 -m timeit -s 'from datetime import date' 'date.today()'
20 loops, best of 5: 1.4 usec per loop
New submission from Anthony Sottile :
I have yet to come across a usecase where `stacklevel=1` makes sense -- usually
it is more helpful to point at the calling code than the function which is
itself warning
my proposal is to update the default for `stacklevel=` from `1` to `2`
an example
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +25093
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/26497
___
Python tracker
<https://bugs.python.org/issu
New submission from Anthony Sottile :
it's missing stacklevel= -- mostly creating a bpo issue to link to
--
messages: 394953
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: self.assertDictContainsSubset warning is unhelpful
versions: Python 3.11
New submission from Anthony Sottile :
for example: https://github.com/asottile/cpython/pull/1
--
messages: 394842
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: cpython forks are spammed with dependabot PRs
___
Python
Anthony Sottile added the comment:
it does not, it restores apis but in a way which requires a huge performance
hit to avoid deprecation warnings
it also still has the 2-500x performance regression I've stated above
--
___
Python tracker
<ht
Anthony Sottile added the comment:
I have also shown that the performance is indeed not better in the nominal
case, as demonstrated in the first case
--
___
Python tracker
<https://bugs.python.org/issue44
Anthony Sottile added the comment:
the toil is still present, the existing, good apis are deprecated and the new,
bad apis are slow -- and the odd subclasses are still present
--
___
Python tracker
<https://bugs.python.org/issue44
Anthony Sottile added the comment:
oops, tiny typo in those code examples, they should say `group=` instead of
`name=` -- though the performance is unchanged:
(first example)
```console
$ ./venv39/bin/python t.py
0.6641988754272461
$ ./venv310/bin/python t.py
1.3172023296356201
```
(second
Anthony Sottile added the comment:
the `.select(...)` api is at least twice as slow as indexing as well:
setup:
```
virtualenv venv39 -p python3.9
venv39/bin/pip install flake8 pytest pytest-randomly
virtualenv venv39 -p python3.10
venv310/bin/pip install flake8 pytest pytest-randomly
Anthony Sottile added the comment:
also https://github.com/miurahr/aqtinstall/issues/221
(this links to importlib-metadata tracker, not sure how you missed it)
--
___
Python tracker
<https://bugs.python.org/issue44
Anthony Sottile added the comment:
I also need `.sort(key=...)` for what it's worth, the error in this issue was
just the first encountered
I think my only satisfactory outcome would be:
- the original api returns actual dicts
- the sub-api returns actual lists
- the new select
Anthony Sottile added the comment:
> Which types are sneaky and look like built-in types but do not act like them?
well for starters, there's the tuple subclass which pretends to be a dict. but
it violates substitutability for both `tuple` and `Mapping` so it's not useful
in eit
Anthony Sottile added the comment:
personally I think they should be reverted -- they were not committed in spirit
with the backwards compatibility policy:
https://www.python.org/dev/peps/pep-0387/#making-incompatible-changes
- I don't think they were discussed thoroughly, and when
Anthony Sottile added the comment:
the "what's new" mentions nothing of this break, nor the aggressive deprecation
warnings, nor the various shifted interfaces (such as this one):
https://docs.python.org/3.10/whatsnew/3.10.html#importli
New submission from Anthony Sottile :
for instance in this issue: https://bugs.python.org/issue44246
it links to 3.1/... instead of 3.10/...
--
messages: 394549
nosy: Anthony Sottile
priority: normal
severity: normal
status: open
title: bpo stacktrace linkifier does not understand
New submission from Anthony Sottile :
this is breaking code that's unfortunately out of my control (vendor) -- also
it looks really wrong
```python
import importlib.metadata
print('looks like a list:')
print(importlib.metadata.distribution('pip').entry_points)
print('first item:')
print
Anthony Sottile added the comment:
that version of flake8 uses multiprocessing (even for 1 file) -- would the ast
objects be involved in that way? (pyflakes also makes reference cyles to handle
"parent" relationships)
--
___
Pyth
Anthony Sottile added the comment:
would it maybe be helpful to bisect a history where the dataclasses / inspect
import change is introduced earlier? this would perhaps help pinpoint the
other commit which is causing this?
--
___
Python tracker
Anthony Sottile added the comment:
vstinner I showed the directions above, but here they are again:
venv\Scripts\pip install flake8==3.6.0
venv\Scripts\pip install -e . --no-deps # ignore the conflict, but fix pyflakes
--
___
Python tracker
Anthony Sottile added the comment:
ah sorry, the branch got squash-merged
this is the equivalent revision after the merge:
f3b1b44bf3d2d5927004fa1c2fcf1ab2def816b9
--
___
Python tracker
<https://bugs.python.org/issue44
Anthony Sottile added the comment:
everything in this virtualenv is pure python so I don't think it's a faulty
third party extension module
--
___
Python tracker
<https://bugs.python.org/issue44
Anthony Sottile added the comment:
I can reproduce it outside of tox using:
venv\Scripts\pip install flake8==3.6.0
venv\Scripts\pip install -e . --no-deps # ignore the conflict, but fix pyflakes
C:\Users\asott\AppData\Local\Temp\y\pyflakes>venv\Scripts\flake8.exe setup.py
C:\Users\as
New submission from Anthony Sottile :
I installed python using the installers from python.org -- I originally
reproduced this using github actions using pyflakes's testsuite
>ver
Microsoft Windows [Version 10.0.19041.985]
>venv\Scripts\python --version
Python 3.10.0b1
C:\Users
Anthony Sottile added the comment:
oddly enough, when I add `-X faulthandler` it passes
___
I did some research on the error message and it looks like the ubuntu
maintainers have found the same thing and reported it here:
https://bugs.python.org/issue36445
this points at (intentional
New submission from Anthony Sottile :
terribly sorry, I don't have much information to go off on this other than the
build logs from deadsnakes.
I retried this build twice and it seems it consistently fails in this position:
https://launchpadlibrarian.net/537139233/buildlog_ubuntu-bionic
Anthony Sottile added the comment:
I've released pytest 6.2.4 for the other breakage (which is unrelated to this
bpo -- it was the asname source position issue)
--
___
Python tracker
<https://bugs.python.org/issue43
Change by Anthony Sottile :
--
nosy: -Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue40465>
___
___
Python-bugs-list mailing list
Unsubscribe:
Anthony Sottile added the comment:
ah yeah that's the `asname` ast change -- if you use the unreleased main branch
it has a fix for that
--
___
Python tracker
<https://bugs.python.org/issue43
Anthony Sottile added the comment:
at least for static analysis of other python constructs it's very convenient to
know from a `Name` node alone whether it's being used in a read or write
context -- without this information an ast traversal needs to maintain more
information about whether
Anthony Sottile added the comment:
and actually, now that I look close it would be useful for `MatchStar` and
`MatchMapping` to also use a `Name(..., ctx=Store())` for their respective
parameters as well
--
___
Python tracker
<ht
Anthony Sottile added the comment:
I'm suggesting instead of:
MatchAs(pattern=None, name='foo')
to have
MatchAs(pattern=None, name=Name('foo', ctx=Store()))
--
___
Python tracker
<https://bugs.python.org/issue43
New submission from Anthony Sottile :
I'm looking at adding support to `match` for pyflakes, and the first impression
I have is that `MatchAs` is unnecessarily different from `Name` with
`ctx=Store()`
if it were represented as the latter pyflakes would not require special
handling of `match
Anthony Sottile added the comment:
can confirm that pytest no longer crashes
--
___
Python tracker
<https://bugs.python.org/issue43933>
___
___
Python-bug
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
nosy_count: 14.0 -> 15.0
pull_requests: +24316
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/25596
___
Python tracker
<https://bugs.python.org/i
New submission from Anthony Sottile :
This is breaking pytest for failed assertions:
https://github.com/pytest-dev/pytest/pull/8227
It also breaks the traceback in the output below
Here's a minimal example:
```python
class Boom:
def __enter__(self):
return self
def __exit__
Anthony Sottile added the comment:
a rebuild succeeded so I'm ok closing this :shrug:
--
stage: -> resolved
status: pending -> closed
___
Python tracker
<https://bugs.python.org/i
Anthony Sottile added the comment:
here's quite a few other cases as well -- I'd love for this to be clarified in
PEP8 such that I can rationalize crafting a rule for it in `pycodestyle` --
https://github.com/PyCQA/pycodestyle/issues/371
--
nosy: +Anthony Sottile
Anthony Flury added the comment:
I fundamentally disagree with closing this - I know that this and many other
'quirks' catch beginners out, and the tutorial is what they use to learn.They
don't look in the reference document - it is too dense in BNF definitions which
turns a lot of people
Anthony Sottile added the comment:
hmmm strange, the only changes in 3.9.4 are a revert -- perhaps this is a
flakey bug in gcc and not actionable
I've clicked rebuild on my build, maybe it'll magically fix it
plus xenial is almost end of lifed so I doubt anyone cares about this strange
New submission from Anthony Sottile :
I realize this is unlikely to be a helpful report, but something that changed
between 3.9.3 and 3.9.4 has caused the build to break on (admittedly a strange
platform) ppc64le
I attached the build log (zipped because otherwise it's too big ?)
The live
Change by Anthony Flury :
--
assignee: -> docs@python
components: +Documentation
nosy: +docs@python
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Flury :
--
type: -> enhancement
___
Python tracker
<https://bugs.python.org/issue43737>
___
___
Python-bugs-list mailing list
Unsubscrib
Change by Anthony Flury :
--
pull_requests: +24015
pull_request: https://github.com/python/cpython/pull/25279
___
Python tracker
<https://bugs.python.org/issue43
Change by Anthony Flury :
--
keywords: +patch
pull_requests: +23957
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25220
___
Python tracker
<https://bugs.python.org/issu
Anthony Flury added the comment:
I am working on a pull request for this.
--
___
Python tracker
<https://bugs.python.org/issue43737>
___
___
Python-bugs-list m
Anthony Flury added the comment:
Should the data structures page also link to the FAQ. The problem with the FAQ
is that most beginners don't even know that == vs 'is' is actually a question
they need to ask, and therefore they aren't likely to look at the FAQ in the
first place
Anthony Flury added the comment:
I take your point about warnings etc - but when you come from other languages
the Python behavior can initially be very surprising.
The reference section has always seemed to be a very technical document,
certainly not targeted at the usual audience
New submission from Anthony Flury :
The behavior of a%b when a is positive and b is negative can be suprising.
I understand that the behavior is so that the identity
a = (a//b)*b + a%b
can be preserved regardless of the signs of a or b.
but the result is different from other languages
anthony shaw added the comment:
Guido, regen.vcxproj targets 142 as the SDK version, which is most likely a
mistake.
The other projects are part of the main PCBuild.sln solution, which has a
variable for the base SDK version.
If you need to change it quickly, you can either open it in VS
Anthony Flury added the comment:
Is PR 25045 the correct Pull request - this Issue is a documentation change -
the linked PR is related to Issue 43433 (a change to xmlrpc.client ?)
--
___
Python tracker
<https://bugs.python.org/issue43
New submission from Anthony Flury :
A commonly asked question on Quora is 'What do *args and **kwargs' mean ?
While it is relatively easy for community to answer these questions the search
tool on the standard documentation doesn't make it easy.
I understand that 'args' and 'kwargs' are both
Anthony Sottile added the comment:
I took a stab at improving the error message (see the linked PR)
$ ./python -c 'import tarfile; tarfile.open("Lib/test/testtar.tar.xz")'
Traceback (most recent call last):
File "", line 1, in
File "/home/asottile/workspace/cpyt
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
nosy_count: 7.0 -> 8.0
pull_requests: +23611
pull_request: https://github.com/python/cpython/pull/24850
___
Python tracker
<https://bugs.python.org/iss
New submission from Anthony Flury :
A frequent bug for beginners is to assume that 'is' is somehow 'better' then
'==' when comparing values, and it is certainly a cause for confusion amongst
beginners as to why:
[1,2] is [1,2] evaluates to False but
'a' is 'a' evaluates to True
anthony shaw added the comment:
Example script attached works perfectly on macOS
> python3.9 test.py
[('default',
'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties'),
('vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes')]
[('defa
anthony shaw added the comment:
which version of Python were you doing this on?
The function in question is
https://github.com/python/cpython/blob/master/Lib/xml/etree/ElementTree.py#L1233-L1278
--
nosy: +anthonypjshaw
___
Python tracker
<ht
Anthony Sottile added the comment:
I haven't looked into or thought about that yet, it might not be possible
It might also make sense to build new tokenize.py apis avoiding the
`readline()` api -- I always found it painful to work
Anthony Sottile added the comment:
Either works for me, would you be able to point me to the starting bits as to
how `_ast` becomes builtin?
--
___
Python tracker
<https://bugs.python.org/issue3
Anthony Sottile added the comment:
private api sounds fine too -- I thought it was necessary to implement the
module (as it needs external linkage) but if it isn't then even better
--
___
Python tracker
<https://bugs.python.org/issue3
Anthony Sottile added the comment:
you already have that right now because the `tokenize` module is exposed.
(except that every change to the tokenization requires it to be implemented
once in C and once in python)
it's much more frustrating when the two differ as well
I don't think all
Anthony Sottile added the comment:
I'm interested in it because the `tokenize` module is painfully slow
--
___
Python tracker
<https://bugs.python.org/issue3
Anthony Sottile added the comment:
Serhiy Storchaka is this still blocked? it's been a few years on either this
or the linked issue and I'm reaching for this one :)
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue3
Anthony Sottile added the comment:
> Anthony: removing 'set' from 'list(set(interable))' is wrong if 'set' were
> added to remove duplicates.
It's not removed, it's changed to a set comprehension (which was added in 2.7
and 3.0)
pyupgrade is very battle tested, having been run
Anthony Sottile added the comment:
just noticed this PR -- you might be interested in pyupgrade which automates
some of these things -- here's (for example) `git ls-files -- Lib/idlelib |
grep '\.py$' | xargs pyupgrade --py36-plus
```diff
diff --git a/Lib/idlelib/calltip_w.py b/Lib/idlelib
Anthony Sottile added the comment:
attached out3.pstats / out3.svg which represent the optimization using
lru_cache instead
--
Added file: https://bugs.python.org/file49764/out3.svg
___
Python tracker
<https://bugs.python.org/issue43
Change by Anthony Sottile :
Added file: https://bugs.python.org/file49763/out3.pstats
___
Python tracker
<https://bugs.python.org/issue43014>
___
___
Python-bugs-list m
1 - 100 of 734 matches
Mail list logo