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 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:
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
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
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-02T
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 in
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 tr
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:
In case it helps someone else, `insstr` seems to not have this limitation
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue8
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +15028
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/15308
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
versions: +Python 3.8, Python 3.9 -Python 3.5
___
Python tracker
<https://bugs.python.org/issue20
Anthony Sottile added the comment:
I threw together a flake8 plugin which checks for these usage patterns:
https://github.com/asottile/flake8-2020
| Code | Description |
||-|
| YTT101
Anthony Sottile added the comment:
neat, this looks like a similar api to astpretty:
https://github.com/asottile/astpretty
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue37
Change by Anthony Sottile :
--
pull_requests: +15320
pull_request: https://github.com/python/cpython/pull/15653
___
Python tracker
<https://bugs.python.org/issue36
Anthony Sottile added the comment:
oops! thanks for the quick fix, I'll double check where I copied this from
since it might have the same bug
--
___
Python tracker
<https://bugs.python.org/is
Anthony Sottile added the comment:
https://github.com/python/cpython/pull/6398/files#diff-fb54fd281a2569006594f7edc6ad90f9R744
hmm I assume _PyDict_GetItemId has different reference semantics?
--
___
Python tracker
<https://bugs.python.
New submission from Anthony Sottile :
https://linux.die.net/man/3/set_escdelay
https://linux.die.net/man/3/set_tabsize
I'd like to help with this, but I don't even know where to start with
argumentclinic -- any points would be greatly appreciated
presumably I should also add g
Anthony Sottile added the comment:
Try with `sh`:
(it prompts for continuation, I pressed ^D to end it)
$ export F=$'\''
>
>
>
>
> sh: 8: Syntax error: Unterminated quoted string
dollar-sign strings are a `bash` extension, I don't think they're s
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +16467
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/16938
___
Python tracker
<https://bugs.python.org/issu
Anthony Sottile added the comment:
should we backport a documentation change for this? (the deprecatedremoved says
4.0 currently)
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue37
Anthony Sottile added the comment:
ah, I'll add those too -- I can do that in the current PR
--
___
Python tracker
<https://bugs.python.org/issue38312>
___
___
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
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/work
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
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 th
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: +Antho
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.
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 __e
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
Anthony Sottile added the comment:
can confirm that pytest no longer crashes
--
___
Python tracker
<https://bugs.python.org/issue43933>
___
___
Python-bug
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 `
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:
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:
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 abo
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/is
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:
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/is
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-b
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 :
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:\
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
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.o
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:
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:
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:
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
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)
p
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
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#imp
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
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 usef
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 sele
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:
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:
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 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:
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:
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
&
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
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
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 :
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
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
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
Anthony Sottile added the comment:
*terry.reedy oops typo!
--
___
Python tracker
<https://bugs.python.org/issue44307>
___
___
Python-bugs-list mailing list
Unsub
Change by Anthony Sottile :
--
components: +Library (Lib)
type: -> behavior
___
Python tracker
<https://bugs.python.org/issue44295>
___
___
Python-bugs-lis
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
venv3
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:
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:
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
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 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 :
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 there
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 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
___
P
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 "&q
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 whic
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
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:
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/is
New submission from Anthony Sottile :
We recently found a bug in one of our codebases that looked ~roughly like this:
class C:
...
def __hash__(self):
return hash((v for k, v in sorted(self.__dict__.items(
which resulted in a production bug
The *intention* was to hash a
Anthony Sottile added the comment:
:shrugs: it did go through a round of code review but was simply missed -- the
testing bit is fair
there are other such mutable objects in python which do define __hash__ = None
such as list and dict
Anthony Sottile added the comment:
function objects are immutable though
--
___
Python tracker
<https://bugs.python.org/issue38769>
___
___
Python-bugs-list m
Anthony Sottile added the comment:
I think I'm missing what you're saying, apologies I'm probably confused :(
--
___
Python tracker
<https://bugs.pyt
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue38883>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Anthony Sottile :
--
pull_requests: +17209
pull_request: https://github.com/python/cpython/pull/17776
___
Python tracker
<https://bugs.python.org/issue37
New submission from Anthony Sottile :
(I've already got a patch for this, just making the necessary issue)
curses.window.inch is pretty useless for any non-ascii character
--
components: Extension Modules
messages: 359309
nosy: Anthony Sottile
priority: normal
severity: normal
s
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +17253
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17825
___
Python tracker
<https://bugs.python.org/issu
New submission from Anthony Sottile :
def f():
def g(arg: int, /):
pass
f()
$ python3.9 t2.py
Traceback (most recent call last):
File "/home/asottile/workspace/t2.py", line 5, in
f()
File "/home/asottile/workspace/t2.py", line 2, in f
def g(arg:
Anthony Sottile added the comment:
Looks as though annotations are using `LOAD_NAME` when they should probably use
`LOAD_GLOBAL`?
```
$ diff -u <(python3.9 -m dis t2.py | sed
's/0x[a-f0-9]*/0xdeadbeef/g;s/t2\.py/FILENAME/g') <(python3.9 -m dis t3.py |
sed 's/0x[a-f0-
Anthony Sottile added the comment:
this triggers an assertion when run with debug enabled:
$ gdb ./python
GNU gdb (Ubuntu 8.1-0ubuntu3.2) 8.1.0.20180409-git
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
T
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +17254
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17826
___
Python tracker
<https://bugs.python.org/issu
New submission from Anthony Sottile :
while fixing bpo-39215, I noticed that there seems to be a place here where
posonlyargs was missed:
https://github.com/python/cpython/blob/7dc72b8d4f2c9d1eed20f314fd6425eab66cbc89/Python/ast_opt.c#L617-L627
not sure if this is intentional or not -- happy
Change by Anthony Sottile :
--
keywords: +patch
pull_requests: +17264
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/17837
___
Python tracker
<https://bugs.python.org/issu
Change by Anthony Sottile :
--
nosy: +Anthony Sottile
___
Python tracker
<https://bugs.python.org/issue39236>
___
___
Python-bugs-list mailing list
Unsubscribe:
Anthony Sottile added the comment:
should I open a new issue for this, or is this an appropriate task to add to
this discussion
shutil.which also doesn't apply `PATHEXT` when the path contains a directory
separator
C:\Users\IEUser\astpretty>venv\Scripts\python --version
Python
Anthony Sottile added the comment:
sure, it's the standard PATHEXT (basically a fresh vm from modern.ie) -- the
only reason I noticed this is I was reading the source:
https://github.com/python/cpython/blob/5bbac8cbdf140ebce446ea4e7db2b20a5d7b8402/Lib/shutil.py#L1367-L1373
C:\Users\I
New submission from Anthony Sottile :
This is distilled from a larger example to be small/silly, however this caused
real problems
A script which was intended for python3.6 exactly was written as follows:
```
#!/usr/bin/env python3.6
...
```
when creating a virtualenv with `python3.6 -m
Anthony Sottile added the comment:
hit this today unfortunately -- I'm working with some pretty complex (and
nested) `typing.NamedTuple` objects and the lack of caching here results in
quite the slowdown (in my macro benchmarks it's the difference between a render
pass taking 180m
Anthony Sottile added the comment:
I would certainly like to see this, it would eliminate my last few hand rolled
temporary directory contexts
Mauro would you be interested in re-posting this patch as a PR to github? (or
allowing someone else to carry your patch forward?)
--
nosy
1 - 100 of 403 matches
Mail list logo