[issue47229] Python tests fail on Chromebook Linux/Bullseye

2022-04-06 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +Tests -IDLE
title: IDLE  UI crashes on Chromebook Linux/Bullseye -> Python tests fail on 
Chromebook Linux/Bullseye
type: crash -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47229] IDLE UI crashes on Chromebook Linux/Bullseye

2022-04-06 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

"Thonny GUI uses the same as IDLE": I presume this means that Thonny also uses 
tkinter and both fail, which means that tkinter is not working right.   Your 
test run indicates that python is not running correctly either.  It only tried 
to run 10 of what should be over 400 tests and 9 of those failed because of 
failure to import the test file.  You should report this to whoever supplies 
python on Chromebook, which I presume is whoever supplies Bullseye.

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed
title: IDLE / Thonny UI crashes on Chromebook Linux/Bullseye -> IDLE  UI 
crashes on Chromebook Linux/Bullseye

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47136] The variable __module__ in the class body getting an undesirable value from __prepare__ of the metaclass

2022-04-06 Thread Takuo Matsuoka


Takuo Matsuoka  added the comment:

Thank you Ethan for your comments.

Sure, I was not familiar with how you measure the magnitude of the
consequences.  The code in my own work was of the kind of the generic
example I gave, but I have abandoned the approach, and don't seem able
to find it any more.  I think the approach turned out not ideal for
the specific aim I had, which I'm sorry I can't recall now.

I might just say there may be circumstances where a not so thoughtful
programmer might get inclined to implementing a metaclass C in some
manner like:

```
class C(type(B)):
# Skip __init__ .  It's just to help checking type later.
def __init__(self, /, *args, **kwargs):
super().__init__(*args, **kwargs)
dict_ = self.__dict__
try:
name = dict_["__name__"]
except KeyError:
pass
else:
name._owner = self
@classmethod
def __prepare__(cls, /, *args, **kwargs):
return dict(__name__ = cls._name(*args, **kwargs))
@classmethod
class _name:
def __get__(self, instance, owner=None):
if instance is None:
if issubclass(owner, self_owner := self._owner):
return self
else:
raise TypeError(f'{owner} is not a subclass of'
f' {self_owner.__qualname__}')
name = instance._super().__name__ # See the class O
# below. 
#
#
# Any procedure here, depending on what you'd like to do
# with the instance of your class...
#
return name
def __init__(self, cls, /, *args, **kwargs): ..
def __set__(self, instance, value): ..
def __delete__(self, instance): ..
```

where she creates instances of the metaclass C by inheriting from:

```
class O(B, metaclass=C):
def _super(self):
return super()
def __init_subclass__(cls, /, *args, **kwargs):
return super().__init_subclass__(*args)
```

Another thing I can say is code that does something like that is not
what I write often or even had written before, I guess.  Still, I
reported the issue thinking some people (possibly including myself)
may come around the kind of code some time in the future again.

If the behaviour is not going to be changed, then I think the
documentation should at least be made sure to warn about it.  I don't
think the behaviour can be expected without documentation.

Thanks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47006] PEP 646: Decide on substitution behavior

2022-04-06 Thread Guido van Rossum


Guido van Rossum  added the comment:

We need to move on this, because the outcome of this discussion is a release 
blocker for 3.11b1 -- the next release!

--
priority: normal -> release blocker
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47061] Deprecate modules listed in PEP 594

2022-04-06 Thread Brett Cannon


Change by Brett Cannon :


--
pull_requests: +30426
pull_request: https://github.com/python/cpython/pull/32392

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 85addfb9c6496eb3d26082348cf5aca848c877ef by Victor Stinner in 
branch 'main':
bpo-35134: Remove the Include/code.h header file (GH-32385)
https://github.com/python/cpython/commit/85addfb9c6496eb3d26082348cf5aca848c877ef


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1: inlining issue in the big _PyEval_EvalFrameDefault() function with Visual Studio (MSC)

2022-04-06 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +30425
pull_request: https://github.com/python/cpython/pull/32387

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5901] missing meta-info in documentation pdf

2022-04-06 Thread C.A.M. Gerlach


Change by C.A.M. Gerlach :


--
keywords: +patch
nosy: +CAM-Gerlach
nosy_count: 5.0 -> 6.0
pull_requests: +30424
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/32386

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue45116] Performance regression 3.10b1: inlining issue in the big _PyEval_EvalFrameDefault() function with Visual Studio (MSC)

2022-04-06 Thread Guido van Rossum


Guido van Rossum  added the comment:

>  -_Py_DECREF (pgo hard reject)

What exactly does "pgo hard reject" mean? I Googled it and found no hits 
besides this very issue.

I am trying to redefine the top three from this error log as macros, but since 
I still don't have stable benchmark results it's hard to know if this has any 
effect.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5c4d1f6e0e192653560ae2941a6677fbf4fbd1f2 by Victor Stinner in 
branch 'main':
bpo-35134: Add Include/cpython/setobject.h header (GH-32384)
https://github.com/python/cpython/commit/5c4d1f6e0e192653560ae2941a6677fbf4fbd1f2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47245] potential undefined behavior with subprocess using vfork() on Linux

2022-04-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Our current assumptions around the use of vfork() are very much glibc specific.

Another useful reference for reasoning, comments, and history is 
https://github.com/golang/go/blob/master/src/syscall/exec_linux.go#L146 
`forkAndExecInChild1`

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47103] Copy pgort140.dll when building for PGO

2022-04-06 Thread Steve Dower


Steve Dower  added the comment:

Backport is blocked on issue47104 (or a randomly successful CI run, which seems 
to occur occasionally).

--
versions: +Python 3.10, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windows (`py -0`) no longer shows star ("*") for default version

2022-04-06 Thread Steve Dower


Change by Steve Dower :


--
assignee:  -> steve.dower
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windows (`py -0`) no longer shows star ("*") for default version

2022-04-06 Thread Steve Dower


Steve Dower  added the comment:


New changeset 2390b2236d4b6ea96217478221d6f7d4b4f344f8 by Steve Dower in branch 
'main':
bpo-47239: Fixes py.exe output when run in a virtual environment. (GH-32364)
https://github.com/python/cpython/commit/2390b2236d4b6ea96217478221d6f7d4b4f344f8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ca219f6dfc57f8f4984f96df0f733b7de92fe91c by Victor Stinner in 
branch 'main':
bpo-35134: Add Include/cpython/complexobject.h header (GH-32383)
https://github.com/python/cpython/commit/ca219f6dfc57f8f4984f96df0f733b7de92fe91c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47245] potential undefined behavior with subprocess using vfork() on Linux

2022-04-06 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
keywords: +3.10regression

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47245] potential undefined behavior with subprocess using vfork() on Linux

2022-04-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Immediate action item: Add a way for people to disable vfork at runtime by 
setting a flag in the subprocess module, just in case.

This can be backported to 3.10 - It'd provide an escape hatch for anyone 
without a need to rebuild Python to disable use of vfork() without resorting to 
LD_PRELOAD hacks.

This is not an urgent issue unless actual practical problems are being observed 
in the field.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47245] potential undefined behavior with subprocess using vfork() on Linux

2022-04-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Can you provide a reproducable way to demonstrate evidence of a problem in 
CPython's use of the Linux libc vfork() implementation?  A test case that 
causes a CPython parent or child process on Linux when built with HAVE_VFORK 
failing to function properly would help prioritize this because in practice 
nobody has reported problems in 3.10.

(we've deployed the subprocess vfork code into thousands production Python 
programs at work in the past year w/o issues being reported - though we have a 
constrained environment with use on only a couple of libc versions and limited 
set of kernels on a few very common architectures)

General thinking (possible dated and incorrect - against what 
https://man7.org/linux/man-pages/man2/vfork.2.html wording claims with its "or 
calls any other function" text):

Pushing additional data onto the stack in the child process _should_ not a 
problem.  That by definition lands in previously unused pre-allocated stack 
space.  If that page faults, that could map a new page into the process state 
shared by both the paused parent and running child. But this page mapping 
should be fine - the child exec that resumes the parent means the parent is the 
only one who sees it.

When the parent process resumes, sure, that data will be in that memory on the 
unallocated portion of stack, but critically the *stack pointer* in the parent 
process (a register) never changes.  As far as I understand things, registers 
are not shared between vfork()ed processes.  So the parent only sees some 
temporary data having been written to the unused region of the stack by the 
since-replaced by exec() child process.  No big deal.

**Untrue wishful thinking**: If a new stack were needed on a given platform for 
use in the vfork()ed child, I'd like it to be the job of libc to take care of 
that for us.  glibc sources do no such thing (every vfork supporting 
architecture has a vfork.S code that appears to make the syscall and jump back 
to the caller without stack manipulation).

--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
stage:  -> test needed
title: Subprocess with vfork() is broken -> potential undefined behavior with 
subprocess using vfork() on Linux
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2022-04-06 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30423
pull_request: https://github.com/python/cpython/pull/32385

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47166] Dataclass transform should ignore TypeAlias variables

2022-04-06 Thread Thomas MK


Thomas MK  added the comment:

There is of course no hard reason for not using the global scope. I just often 
have enums (or other types) that are very closely linked to one class. And it 
makes sense to me then to have a TypeAlias in that class so that I don't have 
to import the enum separately.

For normal classes, the nested TypeAlias works completely fine in the type 
checkers I tested (pyright and mypy). It's just dataclasses that are the 
problem.

But I see now that there is a general wish to keep the implementation of 
dataclass simple, which I can understand.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2022-04-06 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30422
pull_request: https://github.com/python/cpython/pull/32384

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35134] Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details

2022-04-06 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30421
pull_request: https://github.com/python/cpython/pull/32383

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46576] test_peg_generator is extremely slow

2022-04-06 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
pull_requests: +30420
pull_request: https://github.com/python/cpython/pull/32382

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46576] test_peg_generator is extremely slow

2022-04-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 612e422c6ea9df60d3382ed1491d8254c283e93f by Jeremy Kloth in 
branch 'main':
bpo-46576: Speed up test_peg_generator by using a static library for shared 
sources (GH-32338)
https://github.com/python/cpython/commit/612e422c6ea9df60d3382ed1491d8254c283e93f


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35823] Use vfork() in subprocess on Linux

2022-04-06 Thread Марк Коренберг

Марк Коренберг  added the comment:

See #47245.

https://github.com/bminor/glibc/blob/master/sysdeps/unix/sysv/linux/spawni.c#L309

In short - do not use vfork(). Use clone(CLONE_VM | CLONE_VFORK). And build 
separate stack.

Current implementation is heavily broken.

Another guy has failed: https://bugzilla.kernel.org/show_bug.cgi?id=215813.


Please comment calling vfork() as soon as possible in order to fallback to 
fork() implementation. Until you (or me?) write good vfork children code.

--
nosy: +socketpair

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47245] Subprocess with vfork() is broken

2022-04-06 Thread Марк Коренберг

Марк Коренберг  added the comment:

Solution:

https://github.com/bminor/glibc/blob/master/sysdeps/unix/sysv/linux/spawni.c#L309

In short - do not use vfork(). Use clone(CLONE_VM | CLONE_VFORK). and do 
something with stack.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47245] Subprocess with vfork() is broken

2022-04-06 Thread Марк Коренберг

Марк Коренберг  added the comment:

https://github.com/python/cpython/blob/4a08c4c469d36f99d3a5e0f17ad82ab35dcf2835/Modules/_posixsubprocess.c#L717

child_exec(exec_array, argv, envp, cwd,
   p2cread, p2cwrite, c2pread, c2pwrite,
   errread, errwrite, errpipe_read, errpipe_write,
   close_fds, restore_signals, call_setsid,
   call_setgid, gid, call_setgroups, groups_size, groups,
   call_setuid, uid, child_umask, child_sigmask,
   py_fds_to_keep, preexec_fn, preexec_fn_args_tuple);



Py_NO_INLINE static void
child_exec(char *const exec_array[],
   char *const argv[],
   char *const envp[],
   const char *cwd,
   int p2cread, int p2cwrite,
   int c2pread, int c2pwrite,


-

So, calling child_exec pushes to stack GUARANTEED. This is the bug. In fact 
everything works, but is too weak and break at any moment.

Again. Please comment calling vfork() for now. And re-implement child part 
later.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47245] Subprocess with vfork() is broken

2022-04-06 Thread Марк Коренберг

Марк Коренберг  added the comment:

Rewriting in a way that guarantee no stack (and heap) usage. Because stack is 
shared between child and parent. It seems there is no crossplatform way. 
Happily we can use some code like I wrote by link in the first message. OR, 
stick to posix_nspawn which is cross-platform.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47245] Subprocess with vfork() is broken

2022-04-06 Thread Марк Коренберг

New submission from Марк Коренберг :

Using vfork in #35823 is VERY tricky. Please comment out vfork() usage for now. 
Yes, we can (should) use vfork(), but we have to rewrite the child code.

https://bugzilla.kernel.org/show_bug.cgi?id=215813

I would say it's URGENT.

--
components: Extension Modules
messages: 416897
nosy: socketpair
priority: normal
severity: normal
status: open
title: Subprocess with vfork() is broken
versions: Python 3.10, Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47061] Deprecate modules listed in PEP 594

2022-04-06 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset 32b33879c2e19cde735c1971b06869976200e1d8 by Brett Cannon in 
branch 'main':
bpo-47061: use `warnings._deprecated()` with asynchat, asyncore, and smtpd 
(GH-32350)
https://github.com/python/cpython/commit/32b33879c2e19cde735c1971b06869976200e1d8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-06 Thread Ken Jin


Change by Ken Jin :


--
nosy:  -kj

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46769] Improve documentation for `typing.TypeVar`

2022-04-06 Thread Ken Jin


Ken Jin  added the comment:


New changeset d6a7ee69fb3263450ba47bed9104f4a68a08a9bd by Ken Jin in branch 
'3.9':
[3.9] bpo-46769: Fix backticks in typing.rst to appease rstlint (GH-32375)
https://github.com/python/cpython/commit/d6a7ee69fb3263450ba47bed9104f4a68a08a9bd


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46769] Improve documentation for `typing.TypeVar`

2022-04-06 Thread Ken Jin


Ken Jin  added the comment:


New changeset 80af26d25af5568229d31ecb2a8f1bf9702b7791 by Ken Jin in branch 
'3.10':
[3.10] bpo-46769: Fix backticks in typing.rst to appease rstlint (GH-32374)
https://github.com/python/cpython/commit/80af26d25af5568229d31ecb2a8f1bf9702b7791


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-04-06 Thread Ken Jin


Ken Jin  added the comment:

I forgot to specify, that this is *only* on 3.10, not main.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47243] Duplicate entry in 'Objects/unicodetype_db.h'

2022-04-06 Thread LiarPrincess


LiarPrincess  added the comment:

CLA is signed, but there is this 'it might take a few days before your tracker 
profile is updated'.

Added version 3.11 (present also in previous versions, bot no point in 
back-porting it).

Github: https://github.com/python/cpython/pull/32376

--
versions: +Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47244] email.utils.formataddr does not respect double spaces

2022-04-06 Thread Alec Rosenbaum


New submission from Alec Rosenbaum :

It seems that `email.utils.formataddr` and `email.utils.parseaddr` are not 
directly inverse from each other, because `formataddr` does not respect double 
spaces within the "realname" section.

For example:
```
from email.utils import formataddr, parseaddr

identity = '"foo  bar" '

print(formataddr(parseaddr(identity)))
# 'foo  bar '

print(formataddr(parseaddr(formataddr(parseaddr(identity)
# 'foo bar '
```

The first round trip strips the quotes, and the second round trip strips the 
double space in the "realname" section.

The utility function only seems to check for special characters, but it should 
also check for double spaces.

--
components: email
messages: 416891
nosy: AlecRosenbaum, barry, r.david.murray
priority: normal
severity: normal
status: open
title: email.utils.formataddr does not respect double spaces
type: behavior
versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47104] Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase

2022-04-06 Thread Ken Jin


Ken Jin  added the comment:

Andrew, it seems that the post-commit CI has started failing after this commit. 
Specifically it says "test_asyncio failed (env changed)"

>From this page,
https://github.com/python/cpython/commits/3.10?after=3856b4995ec0e632d47b733cdecb5183ac830568+34=3.10

the Ubuntu CI link for that commit:
https://github.com/python/cpython/runs/5667655099?check_suite_focus=true

Failing buildbots on 3.10:
https://buildbot.python.org/all/#/release_status

Sorry that I can't help more. I'm not an asyncio expert so I'm not sure why 
this is triggering.

--
nosy: +kj
resolution: fixed -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47243] Duplicate entry in 'Objects/unicodetype_db.h'

2022-04-06 Thread LiarPrincess


Change by LiarPrincess :


--
keywords: +patch
pull_requests: +30419
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32376

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46769] Improve documentation for `typing.TypeVar`

2022-04-06 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +30418
pull_request: https://github.com/python/cpython/pull/32375

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47243] Duplicate entry in 'Objects/unicodetype_db.h'

2022-04-06 Thread LiarPrincess

New submission from LiarPrincess :

This one is so tiny that I'm not really sure we want to merge it…

=== Problem ===

`Objects/unicodetype_db.h` starts in a following way:

```c
/* a list of unique character type descriptors */
const _PyUnicode_TypeRecord _PyUnicode_TypeRecords[] = {
{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 32},
{0, 0, 0, 0, 0, 48},
…
```

The 1st record (`{0, 0, 0, 0, 0, 0}`) is duplicated.
This is not a problem, since the 1st occurrence is never used, but if we wanted 
to remove it then this is the ticket about it.

=== Detailed description ===

`Objects/unicodetype_db.h` is generated by `Tools/unicode/makeunicodedata.py` 
(I removed irrelevant lines):

```py
def makeunicodetype(unicode, trace):
dummy = (0, 0, 0, 0, 0, 0)
table = [dummy] # (1)
cache = {0: dummy} # (2)

for char in unicode.chars:
# Things…

item = (upper, lower, title, decimal, digit, flags)

i = cache.get(item) # (3)
if i is None:
cache[item] = i = len(table)
table.append(item)

index[char] = i
```

- (1) - list which contains unique character properties (as `(upper, lower, 
title, decimal, digit, flags)` tuples)
- (2) - mapping from character properties to index in `table` - improperly 
initialized as a mapping from index to character properties
- (3) - we check if the current tuple is in `cache`

=== Result ===

The first time we get to a character that has `(0, 0, 0, 0, 0, 0)` properties 
(which is code point 0 - `NULL`) we check if it is in cache. It it not (there 
is an entry that goes from index `0` to `(0, 0, 0, 0, 0, 0)` - the other way 
around), so we add this entry to `table` and `cache`.

=== Fix ===

In the line `(2)` we should have: `cache = {dummy: 0}`. Obviously after doing 
so we have to run `makeunicodedata.py` - this is why this simple change 
modifies a lot of lines.

I will submit PR on github in just a sec…

--
components: Unicode
messages: 416889
nosy: LiarPrincess, ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: Duplicate entry in 'Objects/unicodetype_db.h'
type: enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46769] Improve documentation for `typing.TypeVar`

2022-04-06 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +30417
pull_request: https://github.com/python/cpython/pull/32374

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46721] Optimize set.issuperset() for non-set argument

2022-04-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies:  -Use-after-free by mutating set during set operations
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47211] Remove re.template() and re.TEMPLATE

2022-04-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47227] Suppress expression chaining for RE parsing errors

2022-04-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43464] set intersections should short-circuit

2022-04-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26579] Support pickling slots in subclasses of common classes

2022-04-06 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26579] Support pickling slots in subclasses of common classes

2022-04-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 884eba3c76916889fd6bff3b37b8552bfb4f9566 by Serhiy Storchaka in 
branch 'main':
bpo-26579: Add object.__getstate__(). (GH-2821)
https://github.com/python/cpython/commit/884eba3c76916889fd6bff3b37b8552bfb4f9566


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46721] Optimize set.issuperset() for non-set argument

2022-04-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset a69a4a917c436579c2c4112081ea86a70f1f05d3 by Serhiy Storchaka in 
branch 'main':
bpo-46721: Optimize set.issuperset() for non-set arguments (GH-31280)
https://github.com/python/cpython/commit/a69a4a917c436579c2c4112081ea86a70f1f05d3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43464] set intersections should short-circuit

2022-04-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 31cd25f4e17cd68487dc76c1b2ec162a646818c2 by Serhiy Storchaka in 
branch 'main':
bpo-43464: Optimize set.intersection() for non-set arguments (GH-31316)
https://github.com/python/cpython/commit/31cd25f4e17cd68487dc76c1b2ec162a646818c2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47227] Suppress expression chaining for RE parsing errors

2022-04-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 50872dbadcba1f52867b6f76050cd7b5d0aa1e18 by Serhiy Storchaka in 
branch 'main':
bpo-47227: Suppress expression chaining for more RE parsing errors (GH-32333)
https://github.com/python/cpython/commit/50872dbadcba1f52867b6f76050cd7b5d0aa1e18


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47211] Remove re.template() and re.TEMPLATE

2022-04-06 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b09184bf05b07b77c5ecfedd4daa846be3cbf0a9 by Serhiy Storchaka in 
branch 'main':
bpo-47211: Remove function re.template() and flag re.TEMPLATE (GH-32300)
https://github.com/python/cpython/commit/b09184bf05b07b77c5ecfedd4daa846be3cbf0a9


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47242] Annoying white bar in IDLE (line 457 in sidebar.py)

2022-04-06 Thread antudic


New submission from antudic :

I noticed there was a white bar to the left in my IDLE when I upgraded to 3.10, 
it stuck out like a soar thumb since I have a custom dark theme. This was not 
an issue with earlier versions. After scouring through the code I found the 
perpetrator to be a "padx=2" in sidebar.py on line 457. Changing this value 
from "2" to "0" fixes this issue.

Changing this line of code solves this issue and leaves the color choices up to 
the user, as intended.

--
assignee: terry.reedy
components: IDLE
messages: 416883
nosy: antudic, terry.reedy
priority: normal
severity: normal
status: open
title: Annoying white bar in IDLE (line 457 in sidebar.py)
type: behavior
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-06 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47237] Inheritance from base class with property in class makes them non-instantiatable

2022-04-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

What would dataclasses do that's different from a regular class?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47237] Inheritance from base class with property in class makes them non-instantiatable

2022-04-06 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

I think the behavior with regular classes is expected (that's just how 
inheritance works), but a case could be made that dataclasses should handle 
this case specially.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47237] Inheritance from base class with property in class makes them non-instantiatable

2022-04-06 Thread Guido van Rossum


Guido van Rossum  added the comment:

So is the conclusion that this should be closed as "not a bug"?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47235] Clarify that `assret_called_once_with` sample code is intended typo

2022-04-06 Thread miss-islington


miss-islington  added the comment:


New changeset 770780e63e2a99f842670ef901a257ba64293d6b by Miss Islington (bot) 
in branch '3.9':
bpo-47235: Note where a typo is intentional in code. (GH-32348)
https://github.com/python/cpython/commit/770780e63e2a99f842670ef901a257ba64293d6b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24778] mailcap.findmatch: document shell command Injection danger in filename parameter

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:

In 2022, Python 3.11 still has the issue:

vstinner@apu$ python3.11 -m mailcap
Mailcap files:
/home/vstinner/.mailcap
/etc/mailcap
(...)
Mailcap entries:
(...)
text/html
  copiousoutput
  lineno  5
  view/usr/bin/xdg-open %s

$ python3 -m mailcap text/html 'filename; pwd'
Executing: /usr/bin/xdg-open filename; pwd
(...)
/home/vstinner/python/main



Maybe subst() can be modified to work on a list (as Bernd Dietzel proposed) and 
then use subprocess to avoid shell and so avoid having to pass a single string, 
but pass a *list*
of arguments (strings).

The problem is that it would change the public mailcap.findmatch() API:
"Return a 2-tuple; the first element is a string containing the command line to 
be executed (which can be passed to os.system()), (...)"
https://docs.python.org/dev/library/mailcap.html#mailcap.findmatch

Adding a new findmatch_list() function avoids the backward compatibility issue, 
but the existing findmatch() function would remain vulnerable.

The other problem is that the mailcap.findmatch() function supports "test" 
command which
executes os.system() on string created by mailcap.subst().

Is the mailcap format (RFC 1524) still used in 2022? Does the mailcap module 
still belong to the Python stdlib in 2022?

I propose to:

* (1) Document the shell injection vulnerability: the caller is responsible to 
validate the filename
* (2) Deprecate the mailcap module


A code search in the top 5000 PyPI projects (at 2022-01-26) did not find any 
Python source code using the "mailcap" module. I only found the word "mailcap" 
used to refer to other things:

* https://docs.djangoproject.com/en/4.0/ref/contrib/staticfiles/ mentions a 
"mailcap" RHEL package:

  "This can be achieved, for example, by installing or updating the mailcap 
package on a Red Hat distribution, mime-support on a Debian distribution, or by 
editing the keys under HKEY_CLASSES_ROOT in the Windows registry."

* wxPython refers to "KDE< mailcap and mime.types"

https://docs.djangoproject.com/en/4.0/ref/contrib/staticfiles/

--
nosy: +vstinner
versions: +Python 3.11 -Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47235] Clarify that `assret_called_once_with` sample code is intended typo

2022-04-06 Thread miss-islington


miss-islington  added the comment:


New changeset 3856b4995ec0e632d47b733cdecb5183ac830568 by Miss Islington (bot) 
in branch '3.10':
bpo-47235: Note where a typo is intentional in code. (GH-32348)
https://github.com/python/cpython/commit/3856b4995ec0e632d47b733cdecb5183ac830568


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39812] Avoid daemon threads in concurrent.futures

2022-04-06 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
Removed message: https://bugs.python.org/msg416876

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47235] Clarify that `assret_called_once_with` sample code is intended typo

2022-04-06 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39812] Avoid daemon threads in concurrent.futures

2022-04-06 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

I think this is causing a regression for code that explicitly desires the 
ThreadPoolExecutor to go away abruptly when all other non-daemon threads 
complete (by choosing not to use a with statement, and if shutdown is called, 
calling it with wait=False, or even with those conditions, by creating it from 
a daemon thread of its own).

It doesn't seem like it's necessary, since the motivation was "subinterpreters 
forbid daemon threads" and the same release that contained this change 
(3.9.0alpha6) also contained #40234's change that backed out the change that 
forbade spawning daemon threads in subinterpreters (because they now support 
them by default). If the conflicts with some uses of subinterpreters that make 
it necessary to use non-daemon threads, could that be made a configurable 
option (ideally defaulting to the pre-3.9 choice to use daemon threads)?

--
nosy: +josh.r

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47235] Clarify that `assret_called_once_with` sample code is intended typo

2022-04-06 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30416
pull_request: https://github.com/python/cpython/pull/32368

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47235] Clarify that `assret_called_once_with` sample code is intended typo

2022-04-06 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset ac1fb07b6ecb6b93446484f52894914e5199de63 by Gregory P. Smith in 
branch 'main':
bpo-47235: Note where a typo is intentional in code. (GH-32348)
https://github.com/python/cpython/commit/ac1fb07b6ecb6b93446484f52894914e5199de63


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47235] Clarify that `assret_called_once_with` sample code is intended typo

2022-04-06 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +30415
pull_request: https://github.com/python/cpython/pull/32367

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47169] Stable ABI: Some optional (#ifdef'd) functions aren't handled correctly

2022-04-06 Thread Petr Viktorin


Change by Petr Viktorin :


--
keywords: +patch
pull_requests: +30414
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32365

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47115] Documentation inconsistency with the stable ABI

2022-04-06 Thread Petr Viktorin


Petr Viktorin  added the comment:


New changeset d79f118d044e9b4244b5dfda35448d39202d7f56 by Petr Viktorin in 
branch 'main':
bpo-47115: Document which parts of structs are in limited API/stable ABI 
(GH-32196)
https://github.com/python/cpython/commit/d79f118d044e9b4244b5dfda35448d39202d7f56


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47234] PEP-484 "numeric tower" approach makes it hard/impossible to specify contracts in documentation

2022-04-06 Thread Steven D'Aprano


Change by Steven D'Aprano :


--
nosy: +steven.daprano

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47240] Python 3.x built for ppc+ppc64 errs on: No module named 'msvcrt', '_posixsubprocess'

2022-04-06 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The problem you should look into is why the _posixsubprocess doesn't build, the 
message about msvcrt is a red herring due to the way subprocess.py is 
structured.

Also compare the pyconfig.h files created for the two single architecture 
builds, maybe there are differences in detected features for the two 
architectures (other than CPU differences, there's a pymacconfig.h files that 
sets the correct values for sizes of basic types). 

That said, I won't be debugging this issue myself. MacOS on PowerPC is by now a 
thing of the past and IIRC the last time I had access to a 64-bit PPC machine 
was before GUI code would run properly in PPC64 mode.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47103] Copy pgort140.dll when building for PGO

2022-04-06 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +30413
pull_request: https://github.com/python/cpython/pull/32366

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47168] Improvements for stable ABI definition files

2022-04-06 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +30412
pull_request: https://github.com/python/cpython/pull/32365

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windows (`py -0`) no longer shows star ("*") for default version

2022-04-06 Thread Steve Dower


Steve Dower  added the comment:

PR posted, and here's some sample output with the change:

C:\> py.exe --list
  *   Active venv
 -V:3.11  Python 3.11 (Store)
 -V:3.10  Python 3.10 (Store)
 -V:3.10-32   Python 3.10 (32-bit)
 -V:3.9   Python 3.9 (64-bit)
 -V:3.9-32Python 3.9 (32-bit)
 -V:3.8   Python 3.8 (64-bit)
 -V:3.7   Python 3.7 (64-bit)
 -V:ContinuumAnalytics/Anaconda38-64 Anaconda 2021.05
 -V:ContinuumAnalytics/Anaconda37-64 Anaconda py37_4.8.3

C:\> py.exe --list-paths
  *   C:\Temp\env310\Scripts\python_d.exe
 -V:3.11  
C:\Users\steve\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.11_3847v3x7pw1km\python.exe
 -V:3.10  
C:\Users\steve\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_3847v3x7pw1km\python.exe
 -V:3.10-32   
C:\Users\steve\AppData\Local\Programs\Python\Python310-32\python.exe
 -V:3.9   
C:\Users\steve\AppData\Local\Programs\Python\Python39\python.exe
 -V:3.9-32
C:\Users\steve\AppData\Local\Programs\Python\Python39-32\python.exe
 -V:3.8   C:\Python38\python.exe
 -V:3.7   C:\Python37\python.exe
 -V:ContinuumAnalytics/Anaconda38-64 C:\Users\steve\Anaconda3\python.exe
 -V:ContinuumAnalytics/Anaconda37-64 C:\Users\steve\Miniconda3\python.exe

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39187] urllib.robotparser does not respect the longest match for the rule

2022-04-06 Thread matele secretaire


matele secretaire  added the comment:

I can't find a documentation about it, but all of the robots.txt checkers I 
find behave like this. You can test on this site: 
https://www.st-info.fr/robots.txt, I believe that this is how it's implemented 
now in most parsers ?

--
nosy: +matelesecretaire67

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windows (`py -0`) no longer shows star ("*") for default version

2022-04-06 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +30411
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/32364

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:

The PyFrameObject structure was made opaque by bpo-46836.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47241] [C API] Move the PyCodeObject structure to the internal C API (make the structure opaque)

2022-04-06 Thread STINNER Victor


New submission from STINNER Victor :

The PyCodeObject structure is documented at:
https://docs.python.org/dev/c-api/code.html

The structured evolved a lot in Python 3.11 to optimize Python/ceval.c 
performance:

* read-only co_code (object) was replaced with modifiable co_code_adaptive 
(char[])
* co_varnames, co_freevars and co_cellvars were removed: merged into 
co_localsplusnames with co_localspluskinds
* co_cell2arg was removed
* co_zombieframe ("free list") was removed
* co_opcache, co_opcache_map, co_opcache_flag and co_opcache_size were removed: 
see PEP 659
  https://peps.python.org/pep-0659/

New members:

* co_exceptiontable
* co_warmup, co_code_adaptive
* co_nlocalsplus, co_nplaincellvars, co_ncellvars, co_nfreevars
* co_localsplusnames, co_localspluskinds
* co_qualname
* co_endlinetable, co_columntable

The PyCodeObject structure should be made opaque in the public C API and only 
accessed with function calls.

In Python 3.11, the PyFrameObject structure was made opaque (bpo-46836) and 
multiple getters were added (bpo-40421). The idea is similar, but it might be 
too late to do that in Python 3.11 (beta1 feature freeze is close).

---

By the way, it was proposed multiple times on python-dev to mark the 
PyCode_New() function as "unstable" since its API changed often. PEP 670 
"Python Positional-Only Parameters" caused a lot of troubles in Cython when it 
added a new parameter to PyCode_New(). The change was reverted: instead, a new 
PyCode_NewWithPosOnlyArgs() function was added.

* PyCode_New() has 19 parameters!
* PyCode_NewWithPosOnlyArgs() has 20 parameters!!

On Python 3.11a1 and newer, Cython uses the code.replace() method (added to 
Python 3.8) to build new code objects. Otherwise, it just calls directly 
PyCode_New().
https://docs.python.org/dev/library/types.html#types.CodeType.replace

--
components: C API
messages: 416869
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] Move the PyCodeObject structure to the internal C API (make the 
structure opaque)
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39947] [C API] Make the PyThreadState structure opaque (move it to the internal C API)

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:

I would be nice to make the PyThreadState opaque in Python 3.12. IMO it's too 
late for Python 3.11. Hopefully, Cython should be prepared for such change. At 
the beginning, maybe Cython can just use the internal C API, as it does to 
access the internal PyFrameObject structure.

--
versions: +Python 3.11 -Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:

IMO the initial goal is now reached. I close the issue. Thanks to everyone who 
helped implementing these changes!

The PyFrameObject structure is now opaque in Python 3.11. New getter functions 
of the Python 3.11 C API:

* PyFrame_GetBuiltins()
* PyFrame_GetGenerator()
* PyFrame_GetGlobals()
* PyFrame_GetLocals()

Finally, the PyFrameObject structure now has its own page in the C API 
documentation:
https://docs.python.org/dev/c-api/frame.html

As explained in previous comments, the work is not done: Cython, greenlet, 
gevent and coverage still need more getter and/or setter functions. Adding more 
functions is being discussed in this external issue:
https://github.com/faster-cpython/ideas/issues/309

I propose to open new specific issues to add new functions. For example, open 
an issue to add a getter for the f_lasti member.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 14a9b4895b61bcd46ed968c43c5eec27670a0aac by Victor Stinner in 
branch 'main':
bpo-40421: test_capi uses assertEqual(), not assertEquals() (GH-32361)
https://github.com/python/cpython/commit/14a9b4895b61bcd46ed968c43c5eec27670a0aac


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47189] What's new in Python 3.11: Faster CPython

2022-04-06 Thread Ken Jin


Change by Ken Jin :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-04-06 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 765f6dee0fcf55c6ea258c2be4cc9dfb1b014f60 by Christian Heimes in 
branch 'main':
bpo-40280: WASM defaults to no dynamic linking (GH-32360)
https://github.com/python/cpython/commit/765f6dee0fcf55c6ea258c2be4cc9dfb1b014f60


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40421] [C API] Add public getter functions for the internal PyFrameObject structure

2022-04-06 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30410
pull_request: https://github.com/python/cpython/pull/32361

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windows (`py -0`) no longer shows star ("*") for default version

2022-04-06 Thread Steve Dower


Steve Dower  added the comment:

It's fine here. It affects the same part of the code.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40280] Consider supporting emscripten/webassembly as a build target

2022-04-06 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +30409
pull_request: https://github.com/python/cpython/pull/32360

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:

The change was rejected by the Steering Council:
https://mail.python.org/archives/list/python-...@python.org/message/GFOMU7LP63JUVFMWNJNZJLUMZDRPTUYJ/

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46850] [C API] Move _PyEval_EvalFrameDefault() to the internal C API

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2b4f2f5fa4d1123c19bf0643cfa5a4fe8df4175c by Victor Stinner in 
branch 'main':
Revert "bpo-46850: Move _PyEval_EvalFrameDefault() to internal C API 
(GH-32052)" (GH-32343)
https://github.com/python/cpython/commit/2b4f2f5fa4d1123c19bf0643cfa5a4fe8df4175c


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42238] Deprecate suspicious.py?

2022-04-06 Thread Julien Palard


Julien Palard  added the comment:

One true positive today: https://github.com/python/cpython/pull/32355

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windows (`py -0`) no longer shows star ("*") for default version

2022-04-06 Thread Dutcho


Dutcho  added the comment:

BTW I just found 'py -0p' also no longer shows the 'venv' path

```
(venv) C:\>py -0p
 -V:3.11 *C:\Program Files\Python311\python.exe
 -V:3.10  C:\Program Files\Python310\python.exe
 -V:3.9   C:\Program Files\Python39\python.exe
 -V:3.8   C:\Program Files\Python38\python.exe
(venv) C:\>pip -V
pip 22.0.4 from C:\...\venv\Lib\site-packages\pip (python 3.11)
```

Or should I make a separate bug entry for this?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47189] What's new in Python 3.11: Faster CPython

2022-04-06 Thread Ken Jin


New submission from Ken Jin :


New changeset 9ffe47df5468a72603f730eae48c2fd4ec615ffa by Ken Jin in branch 
'main':
bpo-47189: What's New in 3.11: Faster CPython (GH-32235)
https://github.com/python/cpython/commit/9ffe47df5468a72603f730eae48c2fd4ec615ffa


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47120] Make all jump opcodes relative

2022-04-06 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +30408
pull_request: https://github.com/python/cpython/pull/32359

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windows (`py -0`) no longer shows star ("*") for default version

2022-04-06 Thread Steve Dower


Steve Dower  added the comment:

Good catch, thanks!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47240] Python 3.x built for ppc+ppc64 errs on: No module named 'msvcrt', '_posixsubprocess'

2022-04-06 Thread Sergey Fedorov

New submission from Sergey Fedorov :

While adding definitions for additional universal binary option (ppc+ppc64) is 
rather straightforward (following already existing examples in the source 
code), and Python 3.x after patching do build as universal for named two arch, 
trying to install any python modules fail on the following:

```
--->  Building py39-curl
Traceback (most recent call last):
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py",
 line 73, in 
import msvcrt
ModuleNotFoundError: No module named 'msvcrt'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-curl/py39-curl/work/pycurl-7.44.1/setup.py",
 line 11, in 
import glob, os, re, sys, subprocess
  File 
"/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py",
 line 78, in 
import _posixsubprocess
ModuleNotFoundError: No module named '_posixsubprocess'
Command failed: 
/opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 
setup.py docstrings
Exit code: 1
```

Separately both ppc and ppc64 are totally fine, they build and work, but not 
together.
At the same time `python27` after a similar patch builds as universal 
(ppc+ppc64) and works normally. So the problem somehow arises on 3.x versions.

P. S. I am aware that Darwin PowerPC is an interest for very few users and even 
fewer developers, so I do not expect the upstream to fix this in the code.
However I will greatly appreciate any advice which may point to what I should 
fix on my end. If I can fix Pythons for ppc+ppc64, it will benefit Macports 
users, among whom there are people using Leopard actively.
Relevant ticket on Macports: https://trac.macports.org/ticket/64916
Such fix may also benefit Linux PPC users on G5 machines.

I request moderators not to dismiss & close the issue, if possible. We don’t 
have Python experts on Macports, and all fixes for PowerPC are done by very few 
enthusiasts.

--
components: macOS
messages: 416857
nosy: barracuda156, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: Python 3.x built for ppc+ppc64 errs on: No module named 'msvcrt', 
'_posixsubprocess'
type: compile error
versions: Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windows (`py -0`) no longer shows star ("*") for default version

2022-04-06 Thread Dutcho


Dutcho  added the comment:

That was the case in older versions (up to a6)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windows (`py -0`) no longer shows star ("*") for default version

2022-04-06 Thread Dutcho


New submission from Dutcho :

If doing `py -list` in 3.11.0a7, a star "*" shows on 3.11, even though the 
default (set by environment variable PY_PYTHON) is 3.10, which `py -V` confirms

```
C:\>py --list
 -V:3.11 *Python 3.11 (64-bit)
 -V:3.10  Python 3.10 (64-bit)
 -V:3.9   Python 3.9 (64-bit)
 -V:3.8   Python 3.8 (64-bit)

C:\>py -V
Python 3.10.4
```

--
title: Python Launcher for Windowscd \ -> Python Launcher for Windows (`py -0`) 
no longer shows star ("*") for default version

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47239] Python Launcher for Windowscd \

2022-04-06 Thread Dutcho


Change by Dutcho :


--
components: Windows
nosy: Dutcho, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python Launcher for Windowscd \
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47103] Copy pgort140.dll when building for PGO

2022-04-06 Thread Steve Dower


Steve Dower  added the comment:


New changeset 074da788028c1f1e867dc81698efdcdc263f2288 by Steve Dower in branch 
'main':
bpo-47103: Copy pgort140.dll into output directory when building PGInstrument 
on Windows (GH-32083)
https://github.com/python/cpython/commit/074da788028c1f1e867dc81698efdcdc263f2288


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47237] Inheritance from base class with property in class makes them non-instantiatable

2022-04-06 Thread Eric V. Smith


Change by Eric V. Smith :


--
title: Inheritance from Protocol with property in class makes them 
non-instantiatable -> Inheritance from base class with property in class makes 
them non-instantiatable

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47237] Inheritance from Protocol with property in class makes them non-instantiatable

2022-04-06 Thread Eric V. Smith


Eric V. Smith  added the comment:

Here's the error without dataclasses:

--
from typing import Protocol

class SomeProtocol(Protocol):
@property
def some_value(self) -> str: ...

class SomeClass(SomeProtocol):
def __init__(self, some_value):
self.some_value = some_value

if __name__ == '__main__':
a = SomeClass(some_value="value")
--

Traceback (most recent call last):
  File "foo.py", line 12, in 
a = SomeClass(some_value="value")
^
  File "foo.py", line 9, in __init__
self.some_value = some_value
^^^
AttributeError: property 'some_value' of 'SomeClass' object has no setter


And here it is without Protocol:

class SomeProperty:
@property
def some_value(self) -> str: ...

class SomeClass(SomeProperty):
def __init__(self, some_value):
self.some_value = some_value

if __name__ == '__main__':
a = SomeClass(some_value="value")


Traceback (most recent call last):
  File "foo.py", line 10, in 
a = SomeClass(some_value="value")
^
  File "foo.py", line 7, in __init__
self.some_value = some_value
^^^
AttributeError: property 'some_value' of 'SomeClass' object has no setter

--
title: Inheritance from Protocol with property in dataclass makes them 
non-instantiatable -> Inheritance from Protocol with property in class makes 
them non-instantiatable

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36207] robotsparser deny all with some rules

2022-04-06 Thread STINNER Victor


STINNER Victor  added the comment:

I removed two comments: none of the mentioned URL contains a "Disallow: ?" rule 
and the comments didn't add any value to this issue. It looks like regular spam 
(SEO).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36207] robotsparser deny all with some rules

2022-04-06 Thread STINNER Victor


Change by STINNER Victor :


--
Removed message: https://bugs.python.org/msg416847

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >