[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-03-30 Thread Géry

Géry  added the comment:

By the way:

> I don't think we need two ways to do it.

So do you think we could drop the support for single-argument super?

Michele said in his article:

> There is a single use case for the single argument syntax of super that I am 
> aware of, but I think it gives more troubles than advantages. The use case is 
> the implementation of autosuper made by Guido on his essay about new-style 
> classes.

> If it was me, I would just remove the single argument syntax of super, making 
> it illegal. But this would probably break someone code, so I don't think it 
> will ever happen in Python 2.X. I did ask on the Python 3000 mailing list 
> about removing unbound super object (the title of the thread was let's get 
> rid of unbound super) and this was Guido's reply:

>> Thanks for proposing this -- I've been scratching my head wondering what the 
>> use of unbound super() would be. :-) I'm fine with killing it -- perhaps 
>> someone can do a bit of research to try and find out if there are any 
>> real-life uses (apart from various auto-super clones)? --- Guido van Rossum

> Unfortunaly as of now unbound super objects are still around in Python 3.0, 
> but you should consider them morally deprecated.

--

___
Python tracker 

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



[issue47149] DatagramHandler doing DNS lookup on every log message

2022-03-30 Thread Bruce Merry


Bruce Merry  added the comment:

> But it's going to be non-trivial, I fear.

Yeah. Maybe some documentation is achievable in the short term though, so that 
users who care more about latency than changing DNS are aware that they should 
do the lookup themselves?

--

___
Python tracker 

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



[issue47152] Reorganize the re module sources

2022-03-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It turns out that pip uses sre_constants in its copy of pyparsing. The problem 
is already fixed in the upstream of pyparsing and soon should be fixed in pip. 
We still need to keep sre_constants and maybe other sre_* modules, but 
deprecate them.

> Could the sre_parse and sre_constants modules be kept with public names (i.e. 
> without the leading underscore) but within the re namespace?

It is a good idea which will allow to minimize breakage in short term. You can 
write "from re import sre_parse", and it would work in old and new versions 
because sre_parse and sre_compile were imported in the re module. This trick 
does not work with sre_constants, you still need try/except.

But the code that depends on these modules is fragile and can be broken by 
other ways.

> Please don't merge too close to the 3.11 beta1 release date, I'll submit PRs 
> after this merged.

I am going to implement step 2 only after merging your changes for issue23689.

--

___
Python tracker 

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



[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-30 Thread Inada Naoki


Inada Naoki  added the comment:

@vstiner Since UTF-8 mode affects `locale.getpreferredencoding(False)`, I need 
to decide alternative API in the PEP 686.

If no objections, I will choose `locale.get_encoding()` for current locale 
encoding (ACP on Windows).

See https://github.com/python/peps/pull/2470/files

--

___
Python tracker 

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



[issue23689] Memory leak in Modules/sre_lib.h

2022-03-30 Thread Ma Lin


Change by Ma Lin :


--
pull_requests: +30265
pull_request: https://github.com/python/cpython/pull/32188

___
Python tracker 

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



[issue47152] Reorganize the re module sources

2022-03-30 Thread Ma Lin


Change by Ma Lin :


--
pull_requests: +30266
pull_request: https://github.com/python/cpython/pull/32188

___
Python tracker 

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



[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-30 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Please see https://bugs.python.org/issue47000#msg415769 for what Victor
suggested.

In particular, the locale module uses the "no underscore" convention.
Not sure whether it's good to start using snake case now, but I'm also
not against it.

I would like to reiterate my concern with the "locale" encoding, though.

As mentioned earlier, I believe it adds too much magic. It would be better
to leave this in the hands of the applications and not try to guess
the correct encoding.

It's better to expose easy to use APIs to access the various different
settings and point users to those rather than try to do a best effort
guess... explicit is better than implicit.

After all, Mojibake potentially corrupts important data, without the
alerting the user and that's not really what we should be after (e.g.
UTF-8 is valid Latin-1 in most cases and this is a real problem we often
run into in Germany with our Umlauts).

--

___
Python tracker 

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



[issue47159] multiprocessing.pool.Pool.apply block infinitely when stressed while using maxtasksperchild

2022-03-30 Thread Harsh Patel


New submission from Harsh Patel :

We have a long-running process, which uses thread pool to get tasks and these 
threads then schedule the tasks and send them to multiprocessing.Pool (with 
maxtasksperchild limit set) using apply function. The original codebase is 
large but I have extracted this logic into a simple script for convenience so 
that you can see the issue. The issue is that after sometime the apply function 
call gets blocked infinitely. This only happens when we use maxtasksperchild 
and cause the library for multiple process recreation.

How script works:
Script creates an object of the Manager class which is responsible for creating 
a pool of threads and creating multiprocessing pool. Each thread is provided 
jobs to execute which is done by Scheduler.get_ready_jobs function call. I have 
designed this function in a way that 100 jobs are returned after every 5 calls 
to this function else it returns no jobs. Each thread while performing job 
sends processing_func to multiprocessing pool for execution which just prints 
"processing something" and exits.

Environment:
Python 3.7.10
Clang 12.0.5
MacOS v11.6 intel

Steps to reproduce:
1. Download the attached Python script and execute it
2. Let it run for 10-15 seconds and interrupt the execution

You will notice that some threads will exit successfully but for some, you will 
see the last message printed is "executing cpu_pool apply " which 
indicates these threads are blocked even though the actual processing_func is 
just calling a print function.

Warning: You will also not be able to exit the process without killing it.

As a note, this is my first Python issue report so please let me know if you 
need more information.

--
components: Library (Lib)
files: example.py
messages: 416331
nosy: davin, harsh8398, pitrou
priority: normal
severity: normal
status: open
title: multiprocessing.pool.Pool.apply block infinitely when stressed while 
using maxtasksperchild
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file50706/example.py

___
Python tracker 

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



[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

2022-03-30 Thread Inada Naoki


Inada Naoki  added the comment:

> Please see https://bugs.python.org/issue47000#msg415769 for what Victor
> suggested.

Of course, I read it.

> In particular, the locale module uses the "no underscore" convention.
> Not sure whether it's good to start using snake case now, but I'm also
> not against it.

Victor didn't mention about "no underscore" convention.
I just want to see preference from others. I will remove the underscore.

> I would like to reiterate my concern with the "locale" encoding, though.
>
> As mentioned earlier, I believe it adds too much magic. It would be better
> to leave this in the hands of the applications and not try to guess
> the correct encoding.

I don't recommend to use "locale" encoding for users.
I strongly recommend to consider using "utf-8" instead.
But "locale" encoding is needed when user don't want to change behavior of 
current application.
It had been accepted by PEP 597 already.

> It's better to expose easy to use APIs to access the various different
> settings and point users to those rather than try to do a best effort
> guess... explicit is better than implicit.

In some case, user need to decide "not change the encoding for now".
If we don't provide "locale", it's difficult to change the default encoding to 
UTF-8.

> After all, Mojibake potentially corrupts important data, without the
> alerting the user and that's not really what we should be after (e.g.
> UTF-8 is valid Latin-1 in most cases and this is a real problem we often
> run into in Germany with our Umlauts).

Changing the default encoding will temporary increase this risk.
But after changing the default encoding to UTF-8, this risk will be reduced 
overwhelmingly.
Most popular text editors, including VSCode, Atom, Sublime Text, Notepad.exe 
use UTF-8 by default.

--

___
Python tracker 

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



[issue47160] round function is not working as expected

2022-03-30 Thread ATUL VISHAL


New submission from ATUL VISHAL :

round function is not working as expected .
my number is x= 0.967565*185000= 178999.525
round(x,2)
answer is coming as 178999.52
expected value is 178999.53

--
components: Library (Lib)
files: compiled_result.jpg
messages: 416333
nosy: vishalatul09
priority: normal
severity: normal
status: open
title: round function is not working as expected
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file50707/compiled_result.jpg

___
Python tracker 

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



[issue47151] subprocess fails when used as init, vfork() returns EINVAL if PID=1

2022-03-30 Thread STINNER Victor


STINNER Victor  added the comment:

> Any possibility that you can test the attached PR as pid 1?

Python should be built as a static binary and can be used as the init process 
on the kernel command line, no? I'm not sure that "static binary" is a 
requirement, since I'm commonly using init=/usr/bin/bash to fix a broken Linux, 
and on my Fedora, this program is "dynamically linked".

Who uses Python as pid 1? I'm now curious :-)

--
nosy: +vstinner

___
Python tracker 

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



[issue47127] Specialize call for c functions with METH_FASTCALL|METH_KEYWORDS

2022-03-30 Thread Kumar Aditya


Change by Kumar Aditya :


--
resolution:  -> fixed
stage:  -> 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



[issue46429] Merge all deepfrozen files into one

2022-03-30 Thread Kumar Aditya


Change by Kumar Aditya :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue47126] Update to canonical PEP URLs

2022-03-30 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 6881ea936e277b1733bee581c4e59e3a5d53bb29 by Hugo van Kemenade in 
branch 'main':
bpo-47126: Update to canonical PEP URLs specified by PEP 676 (GH-32124)
https://github.com/python/cpython/commit/6881ea936e277b1733bee581c4e59e3a5d53bb29


--

___
Python tracker 

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



[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Jan Bronicki


New submission from Jan Bronicki :

The `//` path should be equivalent to `/`, and in some ways, it does behave 
like that in pathlib. But in the `relative_to` method on a `Path` object, it 
does not work
This is causing our CI pipeline to fail. In the documentation here you can see 
`//` being properly processed:

https://docs.python.org/3/library/pathlib.html


```python
In [10]: x=Path("/Library/Video") ; x.relative_to(Path("/"))
Out[10]: PosixPath('Library/Video')

In [11]: x=Path("//Library/Video") ; x.relative_to(Path("/"))
---
ValueErrorTraceback (most recent call last)
Input In [11], in ()
> 1 x=Path("//Library/Video") ; x.relative_to(Path("/"))

File ~/.pyenv/versions/3.8.13/lib/python3.8/pathlib.py:908, in 
PurePath.relative_to(self, *other)
906 if (root or drv) if n == 0 else cf(abs_parts[:n]) != cf(to_abs_parts):
907 formatted = self._format_parsed_parts(to_drv, to_root, to_parts)
--> 908 raise ValueError("{!r} does not start with {!r}"
909  .format(str(self), str(formatted)))
910 return self._from_parsed_parts('', root if n == 1 else '',
911abs_parts[n:])

ValueError: '//Library/Video' does not start with '/'
```

--
components: Library (Lib)
messages: 416336
nosy: John15321
priority: normal
severity: normal
status: open
title: pathlib method relative_to doesnt work with // in paths
type: behavior
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



[issue47160] round function is not working as expected

2022-03-30 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

This is documented

https://docs.python.org/3/library/functions.html#round

> The behavior of round() for floats can be surprising: for example, 
> round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: 
> it’s a result of the fact that most decimal fractions can’t be represented 
> exactly as a float. See Floating Point Arithmetic: Issues and Limitations for 
> more information.

--
nosy: +xtreak
resolution:  -> not a bug
stage:  -> 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



[issue34861] Improve cProfile standard output

2022-03-30 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset 75eee1d57eb28283a8682a660d9949afc89fd010 by Daniël van Noord in 
branch 'main':
bpo-34861: Make cumtime the default sorting key for cProfile (GH-31929)
https://github.com/python/cpython/commit/75eee1d57eb28283a8682a660d9949afc89fd010


--
nosy: +pablogsal

___
Python tracker 

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



[issue47162] Add call trampoline to work around bad fpcasts on Emscripten

2022-03-30 Thread Christian Heimes


New submission from Christian Heimes :

WASM cannot handle function calls with bad function pointer casts yet. Hood 
Chatham explained the issue in Pyodide patch 
https://github.com/pyodide/pyodide/blob/0.19.1/cpython/patches/0001-call-trampolines-to-handle-fpcast-troubles.patch

---
The wasm call_indirect instruction takes a function signature as an immediate
argument (an immediate argument is one which is determined statically at compile
time). The web assembly runtime checks at runtime that the function pointer we
are attempting to call has a signature which matches the asserted function
signature, if they don't match, the runtime traps with "indirect call signature
mismatch". The codegen provided by default by the emscripten toolchain produces
an ABI that also has this constraint.

By contrast, typical native ABIs handle function pointer casts very gracefully:
extra arguments are ignored, missing arguments are filled in as 0, even wrong
return values are completely fine.

The Python ecosystem is full of code which contain function pointer casts.
Emscripten offers a second "EMULATE_FPCASTS" ABI that fixes many of these
issues, but it shims in the function pointer cast support in a binaryen pass
that happens on the fully linked wasm module. At this point, lots of information
has been destroyed and as a result the only possible solutions are extremely
costly in run time, stack space, and code size.

We wish to avoid these costs. Patching the packages is prohibitively time
consuming and boring, especially given our limited developer effort. I have
explored making automated detection tools, and these work. However, getting
these tools included into the CI of Python ecosystem packages would be
prohibitively time consuming.

There is a best of both worlds solution. It is possible to define an ABI which
allows for specific types of function pointer casts with neglible costs. I hope
to do this in future work. However, this will require custom llvm passes.
Because llvm is implemented in C++ which has very poor ABI compatibility, this
means our whole toolchain needs to be built against the same version of llvm,
from llvm all the way down to binaryen and the wasm binary toolkit.

In the meantime, most bad function pointer calls happen in a small number of
locations. Calling a function pointer from Javascript has no restrictions on
arguments. Extra arguments can be provided, arguments can be left off, etc with
no issue (this mimics Javascript's typical function call semantics). So at the
locations where the bad calls occur, we patch in a trampoline which calls out to
Javascript to make the call for us. Like magic, the problem is gone. Research
shows that the performance cost of this is surprisingly low too.
---

Bad function pointer casts lead to fatal runtime errors like this:

worker.js onmessage() captured an uncaught exception: RuntimeError: function 
signature mismatch
RuntimeError: function signature mismatch
at create_builtin (:wasm-function[3512]:0x14f6df)
at _imp_create_builtin (:wasm-function[3520]:0x14fe1d)
at cfunction_vectorcall_O (:wasm-function[1871]:0x91e84)
at _PyVectorcall_Call (:wasm-function[839]:0x4e220)
at _PyObject_Call (:wasm-function[842]:0x4e4f5)
at PyObject_Call (:wasm-function[843]:0x4e595)
at _PyEval_EvalFrameDefault (:wasm-function[3114]:0x120541)
at _PyEval_Vector (:wasm-function[3115]:0x1229ab)
at _PyFunction_Vectorcall (:wasm-function[845]:0x4e6ca)
at object_vacall (:wasm-function[859]:0x4f3d0)
worker sent an error! undefined:undefined: function signature mismatch


I propose to include the downstream patch from Pyodide but make the call 
trampoline feature opt-in. An opt-in allows Pyodide to use the trampolines in 
production while we can test core and 3rd party modules without the trampoline 
easily.

--
components: Interpreter Core
messages: 416339
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: Add call trampoline to work around bad fpcasts on Emscripten
type: compile error
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



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

2022-03-30 Thread Christian Heimes


Change by Christian Heimes :


--
dependencies: +Add call trampoline to work around bad fpcasts on Emscripten

___
Python tracker 

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



[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Ned Batchelder


New submission from Ned Batchelder :

In this code, the same regex is compiled with and without re.VERBOSE.  Without, 
it compiles fine.  With, it fails with an "unterminated subpattern" error.

list_num_rx1 = r"""(?P\()?(\d+|#|[a-z])(?(paren)\)|\.)"""
list_num_rx2 = r"""(?x)(?P\()?(\d+|#|[a-z])(?(paren)\)|\.)"""

# This works:
re.compile(list_num_rx1)
# Either of these fails:
re.compile(list_num_rx1, flags=re.VERBOSE)
re.compile(list_num_rx2)

(What I really wanted was this, but the error happens without the multiline 
string:)

list_num_rx = r"""(?x)
(?P\()?  # maybe an opening paren
(\d+|#|[a-z])   # the number: 123, or #, or a-z
(?(paren)   # if we had an opening paren..
\)| #   then we need a closing paren
\.  #   otherwise a dot.
)
"""

--
components: Regular Expressions
messages: 416340
nosy: ezio.melotti, mrabarnett, nedbat
priority: normal
severity: normal
status: open
title: "unterminated subpattern" in valid regex if re.VERBOSE is used

___
Python tracker 

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



[issue39114] Python 3.9.0a2 changed how finally/return is traced

2022-03-30 Thread Irit Katriel


Change by Irit Katriel :


--
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



[issue47126] Update to canonical PEP URLs

2022-03-30 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
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



[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Ned Batchelder


Ned Batchelder  added the comment:

I realized my mistake... never mind!

--
resolution:  -> not a bug
stage:  -> 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



[issue47126] Update to canonical PEP URLs

2022-03-30 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
stage: resolved -> patch review

___
Python tracker 

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



[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Oleg Iarygin


Oleg Iarygin  added the comment:

I started to investigate and found that a double slash in the beginning cancels 
any parsing of a path:

>>> Path("//Library/Video")._parts
['Library\\Video\\']

vs

>>> Path("/Library/Video")._parts
['\\', 'Library', 'Video']

Investigating further.

--
nosy: +arhadthedev

___
Python tracker 

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



[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

"#" in VERBOSE mode starts a comment and skips to the end of the line. Escape 
it: "\#".

--
nosy: +serhiy.storchaka
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue47163] "unterminated subpattern" in valid regex if re.VERBOSE is used

2022-03-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> not a bug
stage:  -> 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



[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-30 Thread Grégory Starck

Grégory Starck  added the comment:

I guess it could be done relatively easily.

but the question is more: should it be done ?

--

___
Python tracker 

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



[issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0)

2022-03-30 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset f08a191882f75bb79d42a49039892105b2212fb9 by Andrew Svetlov in 
branch 'main':
bpo-39622: Interrupt the main asyncio task on Ctrl+C (GH-32105)
https://github.com/python/cpython/commit/f08a191882f75bb79d42a49039892105b2212fb9


--

___
Python tracker 

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



[issue47162] Add call trampoline to work around bad fpcasts on Emscripten

2022-03-30 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue39622] Handle KeyboardInterrupt in asyncio

2022-03-30 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: KeyboardInterrupt is ignored when await asyncio.sleep(0) -> Handle 
KeyboardInterrupt in asyncio
versions: +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



[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Oleg Iarygin


Oleg Iarygin  added the comment:

As I found out, any path starting with two double slashes is treated as an UNC 
(network) path:

 root
\\machine\mountpoint\directory\etc\...
   directory ^

So "/Library/Video" and "/" are directories mounted on your machine while 
"//Library/Video" is a computer named "Library" with a share named "Video".

However, an error message in Python 3.8 (as a file path suggests) is 
misleading. In 3.11 it was changed to "'\\Library\Video\' is not in the subpath 
of '\' OR one path is relative and the other is absolute."

--

___
Python tracker 

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



[issue24837] await process.wait() does not work with a new_event_loop

2022-03-30 Thread Kumar Aditya


Kumar Aditya  added the comment:

@asvetlov This is bug no longer exists, on main branch this is the output and 
it does not hangs:

DEBUG:asyncio:Using selector: EpollSelector
True

--
nosy: +asvetlov, kumaraditya

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread STINNER Victor


New submission from STINNER Victor :

Last years, I started to add "CAST" macros like:

#define _PyObject_CAST(op) ((PyObject*)(op))
#define _PyType_CAST(op) (assert(PyType_Check(op)), (PyTypeObject*)(op))

Example of usage:

#define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), 
type)

These macros avoids parenthesis. Example without CAST macro:

#define PyCFunction_GET_FLAGS(func) \
(((PyCFunctionObject *)func) -> m_ml -> ml_flags)

Currently, inline cast requires adding parenthesis:

   ((PyCFunctionObject *)func)

IMO it's more readable with a CAST macro:

#define _PyCFunction_CAST(func) ((PyCFunctionObject *)func)
#define PyCFunction_GET_FLAGS(func) \
(_PyCFunction_CAST(func)->m_ml->ml_flags)


I propose to add more CAST macros.

By the way, the current Python C API is not fully compatible with C++. 
"(type)expr" C syntax is seen as "old-style cast" in C++ which recommends 
static_cast(expr), reinterpret_cast(expr), or another kind of cast. 
But I prefer to discuss C++ in a separated issue ;-) IMO without considering 
C++, adding CAST macros is worth it for readability.

I am preparing pull requests for add CAST macros and use existing CAST macros.

--
components: C API
messages: 416350
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] Add private "CAST" macros to clean up casts in C code
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



[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Oleg Iarygin


Oleg Iarygin  added the comment:

Also, the error message cannot be fixed because for 3.8 only security fixes are 
accepted since May 2021. For 3.9 and later, the message is already corrected.

--

___
Python tracker 

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



[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Jan Bronicki


Jan Bronicki  added the comment:

But shouldn't it just work with `//` as a `/`? It seems like this is the 
behavior elsewhere. Sure I get that it cannot be done for 3.8. But the new 
error message implies that either `//` is not a subpath of `/` which it is, or 
that one is relative and the other is absolute, which is also false because 
both are absolutes

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Mark Shannon


Mark Shannon  added the comment:

I think that adding macros makes readability worse.

The macro is only more readable if you already know what it does.
If you don't, then you need to look up the macro, and understand the cast in 
the macro (which is harder than understanding the original cast).


In general, I find the excessive use of macros and tiny inline function 
obscures the meaning of code, and makes it hard to reason about what the code 
is doing.

A few well chosen macros (like Py_INCREF(), etc) can definitely help 
readability, but if there are too many then anyone reading the code ends up 
having to lookup loads of macro definitions to understand the code.



Without the macro, the reader needs to parse the cast, which is admittedly a

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Mark Shannon


Mark Shannon  added the comment:

The problem in the example you give is the need for the cast in the first 
place. If `func` were a `PyCFunctionObject *` instead of a `PyObject *`, then 
there would be no cast.


Making the casts explicit serves as a reminder that a type check is needed.

```
PyObject *func = ...;
int flags = PyCFunction_GET_FLAGS(func);
```

is dangerous.

```
PyObject *obj = ...;
if (PyCFunction_Check(obj)) {
PyCFunctionObject *func = (PyCFunctionObject *)obj;
int flags = func->m_ml->ml_flags;
```

is safe.

--

___
Python tracker 

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



[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Oleg Iarygin


Oleg Iarygin  added the comment:

> But shouldn't it just work with `//` as a `/`? It seems like this is the 
> behavior elsewhere.

It works elsewhere because empty directory names are impossible so can be 
dropped. But if `//` is placed in the beginning, it gets a special meaning that 
totally changes the whole path so its plain replacement would give a totally 
wrong one.

Roughly speaking, "//Library/Video" is `/Video` on a computer named `Library`.

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30269
pull_request: https://github.com/python/cpython/pull/32191

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +30270
pull_request: https://github.com/python/cpython/pull/32192

___
Python tracker 

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



[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Jan Bronicki


Jan Bronicki  added the comment:

Hmm..., I get it, but Im not gonna lie it's pretty confusing given that in 
other places `//` works as a substitute for `/`. Maybe it should be mentioned 
in the documentation?

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Ken Jin


Ken Jin  added the comment:

> tiny inline function obscures the meaning of code

Sadly I have to agree with Mark for that specific case. I've had to debug a 
segfault before only because the inline function implicitly cast its arguments, 
and it was accessing a non-existent member. If it were a macro it would access 
the struct member directly, and the compiler would be able to catch that and 
warn me before runtime.

However, for the case of _PyCFunctionObject_CAST, I'm not against it. The 
assert(PyCFunction_Check) pattern has genuinely helped me catch problems in the 
case of similar macros.

--
nosy: +kj

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread STINNER Victor


STINNER Victor  added the comment:

> I think that adding macros makes readability worse.

See the attached PRs, I can remove multiple layers of parenthesis in macros by 
using CAST macros.

> ```
> PyObject *func = ...;
> int flags = PyCFunction_GET_FLAGS(func);
> ```
>
> is dangerous.

Right.

PEP 670 proposes to remove the cast, but only in the limited C API version 3.11 
or newer. Sadly, I don't think that we can remove the cast in the general 
Python C API, it would simply add too many compiler warnings in existing C 
extensions which previously built without warnings. (See also PEP 670 
discussions on python-dev).

Currently, PyCFunction_GET_FLAGS() doesn't check its argument. The macro 
documentation is quite explicit about it:

/* Macros for direct access to these values. Type checks are *not*
   done, so use with care. */

My GH-32190 PR adds a check in debug mode. So using PyCFunction_GET_FLAGS() in 
debug mode is safer with this PR.

--

___
Python tracker 

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



[issue47165] [C API] Test that the Python C API is compatible with C++

2022-03-30 Thread STINNER Victor


New submission from STINNER Victor :

There are more and more popular projects using the Python C API. The first big 
player is pybind11:
"Seamless operability between C++11 and Python"
https://pybind11.readthedocs.io/

Recently, I proposed a PR to add Python 3.11 support to the datatable project:
https://github.com/h2oai/datatable/pull/3231

My PR uses pythoncapi_compat.h header file which provides recent C API 
functions to old Python functions. The header file implements these functions 
as static inline function.

Problem: a static inline function implemented in a C header file used in a C++ 
code file can emit C++ compiler warnings.

In datatable, I got two kinds of C++ compiler warnings:

* Usage of the C NULL constant: C++ prefers nullptr
* "Old-style" cast like (PyObject*)obj: C++ prefers static_cast, 
reinterpret_cast, etc.

It seems like these compiler warnings are not enabled by default. The datatable 
project seems enabling them in its CI and I was asked to fix these warnings.

In the pythoncapi-compat project (*), I chose to use nullptr and 
reinterpret_cast if the "__cplusplus" macro is defined. Example:

---
// C++ compatibility
#ifdef __cplusplus
#  define PYCAPI_COMPAT_CAST(TYPE, EXPR) reinterpret_cast(EXPR)
#  define PYCAPI_COMPAT_NULL nullptr
#else
#  define PYCAPI_COMPAT_CAST(TYPE, EXPR) ((TYPE)(EXPR))
#  define PYCAPI_COMPAT_NULL NULL
#endif

// Cast argument to PyObject* type.
#ifndef _PyObject_CAST
#  define _PyObject_CAST(op) PYCAPI_COMPAT_CAST(PyObject*, op)
#endif
---

(*) https://github.com/python/pythoncapi_compat


It's unclear to me if the Python C API has or has not the same issue than 
pythoncapi_compat.h.


Last years, some old macros of the Python C API have been converted to static 
inline functions, like Py_INCREF(). It's unclear to me if these compiler 
warnings happen on Py_INCREF(). I don't understand why, but static inline 
macros from Python.h didn't emit compiler warnings in datatable, whereas 
similar static inline functions of pythoncapi_compat.h emitted compiler 
warnings.

Maybe there is a difference between  and "Python.h". Or maybe it 
depends if the header file is a "local" file, or a "system" header file (ex: 
installed in /usr/include/ on Linux).


A first step would be to build a C++ extension as part of the Python test suite 
and check that there is no compiler warning. My GH-32175 PR is a 
proof-of-concept of that.

I don't know which C++ version we should target. pybind11 targets C++11. See 
bpo-39355 for a discussion about C++20: usage of the C++20 "module" keyword... 
which is a "contextual keyword" in practice.

--
components: C API
messages: 416359
nosy: vstinner
priority: normal
severity: normal
status: open
title: [C API] Test that the Python C API is compatible with C++
type: enhancement
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



[issue39355] The Python library will not compile with a C++2020 compiler because the code uses the reserved “module” keyword

2022-03-30 Thread STINNER Victor


STINNER Victor  added the comment:

Follow-up issue: bpo-47165 "[C API] Test that the Python C API is compatible 
with C++".

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread STINNER Victor


STINNER Victor  added the comment:

> By the way, the current Python C API is not fully compatible with C++. (...)

I created bpo-47165 "[C API] Test that the Python C API is compatible with C++".

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread STINNER Victor


STINNER Victor  added the comment:

Hum, there are two things and maybe we are not talking about the same thing.

* (A) Modifying macros defined in the Python C API (Include/ header files) 
doing cast on their arguments to use CAST macros
* (B) Modify C code doing casts to use CAST macros

I created this issue for (A). I propose to do (B), but this part is optional.

Mark, Ken: are you fine with (A)? Is your concern about (B)?

But modifying macros to remove the cast of their argument is out of the scope 
of this issue. As I wrote, it would add compiler warnings, something that I 
would like to avoid. See:
https://peps.python.org/pep-0670/#cast-pointer-arguments

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread STINNER Victor


STINNER Victor  added the comment:

GH-32192 "Add _PyCFunction_CAST() macro" is special. It's used to define 
functions in PyTypeObject.tp_methods or PyModuleDef.m_methods.

Casting a function pointer can cause issues with Control Flow Integrity (CFI) 
implemented in LLVM. The _thread module has an undefined behavior fixed by the 
commit 9eea6eaf23067880f4af3a130e3f67c9812e2f30 of bpo-33015. Previously, a 
cast ignored that the callback has no return value, whereas pthread_create() 
requires a function which as a void* return value.

To fix compiler warnings, the (PyCFunction)func cast was replaced with the 
(PyCFunction)(void(*)(void))func cast to fix bpo-bpo-33012 GCC 8 compiler 
warning:

warning: cast between incompatible function types (...)

--

___
Python tracker 

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



[issue47135] Allow decimal.localcontext to accept keyword arguments to set context attributes

2022-03-30 Thread Nick Coghlan


Nick Coghlan  added the comment:

Seems reasonable to me, but I think a full implementation would want to throw 
an error for keyword args that don't already exist as context attributes 
(otherwise typos would fail silently)

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread Ken Jin


Ken Jin  added the comment:

@Victor,

I'm not against (A) or any of the PRs you proposed. They look fine to me. My 
concern was with certain static inline functions (there are none here :). The 
_CAST macros have genuinely helped me debug code before.

--

___
Python tracker 

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



[issue46964] The global config should not be stored on each interpreter

2022-03-30 Thread Nick Coghlan


Nick Coghlan  added the comment:

I agree the status quo has its benefits. However, it has the distinct downside 
that because each interpreter has its own storage for copied settings, other 
code has to assume the settings *might* be different in each interpreter, even 
if they're currently always the same.

If the invariant bits are moved out, then it clearly indicates when code can 
safely assume that every interpreter will be seeing the same value.

--

___
Python tracker 

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



[issue36692] Unexpected stderr output from test_sys_settrace

2022-03-30 Thread Nick Coghlan


Nick Coghlan  added the comment:

I'm not, so I assume this got cleaned up somewhere along the way.

--
resolution:  -> out of date
stage: needs patch -> resolved
status: pending -> closed

___
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-03-30 Thread Thomas MK


New submission from Thomas MK :

The dataclass transformation ignores attributes that are annotated as ClassVar. 
I think it should also ignore attributes that are annotated as TypeAlias.

Specifically, I have this usecase in mind:


class RunMode(Enum):
release = auto()
debug = auto()

@dataclass
class Run:
Mode: TypeAlias = RunMode
mode: Mode = Mode.release

--
components: Library (Lib)
messages: 416368
nosy: thomkeh
priority: normal
severity: normal
status: open
title: Dataclass transform should ignore TypeAlias variables
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



[issue47161] pathlib method relative_to doesnt work with // in paths

2022-03-30 Thread Oleg Iarygin


Change by Oleg Iarygin :


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

___
Python tracker 

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



[issue46337] urllib.parse: Allow more flexibility in schemes and URL resolution behavior

2022-03-30 Thread Ethan Furman

Ethan Furman  added the comment:

Éric Araujo wrote on PR30520:

> No, we should not redefine the behavior of urlparse.
> 
> I was always talking about adding another function. Yes it can be a one-liner,
> but my point is that I don’t see the usefulness of having the separate flags 
> to
> pick and choose parts of standard parsing.

I suspect the usefulness comes from error checking -- if a scheme doesn't 
support parameters, then having what looks like parameters converted would not 
be helpful.

Further, while a new function is definitely safer, how many parse options do we 
need?  Anyone else remember `os.popen()`, `os.popen2`, `os.popen3`, and, 
finally, `os.popen4()`?

Assuming we just enhance the existing function, would it be more palatable if 
there was a `SchemeFlag.ALL`, so universal parsing was just 
`urlparse(uri_string, flags=SchemeFlag.ALL)`?  To be really user-friendly, we 
could have:

class SchemeFlag(Flag):
RELATIVE = auto()
NETLOC = auto()
PARAMS = auto()
UNIVERSAL = RELATIVE | NETLOC | PARAMS
#
def __repr__(self):
return f"{self.module}.{self._name_}"
__str__ = __repr__
RELATIVE, NETLOC, PARAMS, UNIVERSAL = SchemeFlag

Then the above call becomes:

urlparse(uri_string, flags=UNIVERSAL)

--

___
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-03-30 Thread Petr Viktorin


Petr Viktorin  added the comment:

So. According to PEP 384 (which added all structs in the stable ABI, except 
Py_buffer), some structs are opaque and others have a few members exposed:
https://peps.python.org/pep-0384/#structures

I will split the latter into 1) structs that have a few fields exposed mainly 
for backwards compatibility (which, of course, is very important here). Best 
practice is to treat them as opaque (use getters/setters):

- PyObject (ob_refcnt, ob_type)
- PyVarObject (ob_base, ob_size)

... and 2) structs for which all fields are part of the ABI (and the struct's 
size as well: for most of these as users are expected to provide arrays):

- PyMethodDef
- PyMemberDef
- PyGetSetDef
- PyModuleDefBase
- PyModuleDef
- PyStructSequence_Field
- PyStructSequence_Desc
- PyType_Slot
- PyType_Spec
- Py_buffer (new in 3.11)

The opaque structs continue to be:

- PyThreadState
- PyInterpreterState
- PyFrameObject
- symtable
- PyWeakReference
- PyLongObject
- PyTypeObject

--
nosy: +vstinner

___
Python tracker 

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



[issue47092] [C API] Add PyFrame_GetVar(frame, name) function

2022-03-30 Thread Nick Coghlan


Nick Coghlan  added the comment:

Mark's suggested frame stack API makes sense to me, but being able to get/set 
specific values through the full frame API seems like it would be useful even 
if the lower level API existed - if we don't get one of the proxy PEPs in shape 
to land in 3.11, trace functions written in C could still use this to avoid 
materialising the locals dict if they only needed to manipulate specific values.

Even after a fast locals proxy is defined, there would still be some saving in 
skipping creating the proxy object when only accessing known keys.

We'd need the name-to-index mapping on the code objects to implement this API 
efficiently, but that isn't a PEP level change in its own right (the proxy PEPs 
only mention it because they need it)

--

___
Python tracker 

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



[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

2022-03-30 Thread STINNER Victor


STINNER Victor  added the comment:

> I've had to debug a segfault before only because the inline function 
> implicitly cast its arguments, and it was accessing a non-existent member. If 
> it were a macro it would access the struct member directly, and the compiler 
> would be able to catch that and warn me before runtime.

This is part of Python C API legacy and as I wrote, it's not going to change 
soon. The minor enhancement that we can do is to inject an assertion when 
Python is built in debug mode.

--

___
Python tracker 

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



[issue47099] Replace with_traceback() with exception chaining and reraising

2022-03-30 Thread Oleg Iarygin


Change by Oleg Iarygin :


--
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



[issue47115] Documentation inconsistency with the stable ABI

2022-03-30 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue46964] The global config should not be stored on each interpreter

2022-03-30 Thread STINNER Victor


STINNER Victor  added the comment:

> If the invariant bits are moved out, then it clearly indicates when code can 
> safely assume that every interpreter will be seeing the same value.

What is the benefit of that? Do you have an example?

--

___
Python tracker 

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



[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-30 Thread Andrew Svetlov


New submission from Andrew Svetlov :

Now asyncio.Task has a strict hardcoded check for futures processes on task's 
step.
Sometimes third-party library [1] wants to replace it with custom logic.
Currently it is impossible without implementing the full asyncio.Task 
replacement from scratch.
`asyncio.Task` is a non-trivial highly optimized part of async, keeping a 
third-party version in sync with the reference implementation takes more time 
and effort than it should be.

This issue proposes adding `Task._check_future(future)` method that could be 
overridden in subclasses.  The default C implementation uses a fast path that 
has no performance penalty.

1. https://github.com/aio-libs/aioloop-proxy implements nested loop proxies 
that are very useful for writing tests. A proxy can work in parallel with 
ancestors but checks all own acquired resources cleanup on 
the proxy closing.

--
components: asyncio
messages: 416374
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Allow overriding future-task compliance check in  asyncio
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



[issue47167] Allow overriding future-task compliance check in asyncio

2022-03-30 Thread Andrew Svetlov


Change by Andrew Svetlov :


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

___
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-03-30 Thread Petr Viktorin


Change by Petr Viktorin :


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

___
Python tracker 

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



[issue24837] await process.wait() does not work with a new_event_loop

2022-03-30 Thread Guido van Rossum


Guido van Rossum  added the comment:

Okay let's close it then. :-)

--
resolution:  -> out of date
stage:  -> 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



[issue47168] Improvements for stable ABI definition files

2022-03-30 Thread Petr Viktorin


New submission from Petr Viktorin :

This issue groups together a few changes I'd like to make:

- Rename Doc/data/stable_abi.dat to *.csv, so it gets syntax highlighting. (The 
only user of that file should be the Sphinx extension)
- Mark autogenerated files as such in .gitattributes
- Convert Misc/stable_abi.txt to TOML, and change the parser to match (this 
will need a heads-up on python-dev)

--
messages: 416376
nosy: petr.viktorin
priority: normal
severity: normal
status: open
title: Improvements for stable ABI definition files

___
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-03-30 Thread Petr Viktorin


New submission from Petr Viktorin :

- PyThread_get_thread_native_id is only available when PY_HAVE_THREAD_NATIVE_ID 
is defined. The test currently always expects it to be available.
- PyOS_CheckStack is only available when USE_STACKCHECK is defined (i.e. on 
Windows). It should be exported from the DLL.

I plan to:
- add the appropriate metadata
- improve handling & testing of such optional functions in general

--
components: C API
messages: 416377
nosy: petr.viktorin
priority: normal
severity: normal
status: open
title: Stable ABI: Some optional (#ifdef'd) functions aren't handled correctly

___
Python tracker 

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



[issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported on Unix

2022-03-30 Thread Petr Viktorin


Petr Viktorin  added the comment:

> Ah, sorry, I could have described the issue better. It's not a problem with 
> exporting, PyThread_get_thread_native_id() isn't available on Solaris (and 
> possibly other platforms) at all.

Jakub, does this mean test_stable_abi_ctypes fails on Solaris?
Are there any other missing functions?
I opened bpo-47169 to improve the situation.

--

___
Python tracker 

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



[issue47146] PR check "Check if generated files are up to date" failing intermittently

2022-03-30 Thread Eric Snow

Eric Snow  added the comment:

Looks like this is still an intermittent problem:

* https://github.com/python/cpython/pull/32195
  + failed: https://github.com/python/cpython/runs/5756616733
  + failed: https://github.com/python/cpython/runs/5753267869
  + failed: https://github.com/python/cpython/runs/5757169625
* https://github.com/python/cpython/pull/32114
  + failed: https://github.com/python/cpython/runs/5756616733
  + passed: https://github.com/python/cpython/runs/5757213346
* https://github.com/python/cpython/pull/32186
  + failed: ...
  + passed: https://github.com/python/cpython/runs/5757178754


Per Mark Shannon (on discord):

The "Check if generated files are up to date" is still failing consistently. It 
looks like the makefile is missing a dependency on the 
./Programs/_freeze_module for targets that require /Programs/_freeze_module

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

___
Python tracker 

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



[issue47170] py launcher on windows opens new terminal window when parsing python script with shebang

2022-03-30 Thread Christian Ascia


New submission from Christian Ascia :

Hi, as the title describes, i noticed this unfornutate behavior preventing me 
to run directly python scripts in terminal without using the py command. I 
searched in the documentation but i couldn't find flags to prevent py launcher 
from opening a new window.

--
components: Windows
messages: 416380
nosy: asciachristian, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: py launcher on windows opens new terminal window when parsing python 
script with shebang
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



[issue47170] py launcher on windows opens new terminal window when parsing python script with shebang

2022-03-30 Thread Steve Dower


Steve Dower  added the comment:

Are you saying this happens when you run "py.exe my-script.py"? Or only when 
you run "my-script.py" (without the py.exe)?

--

___
Python tracker 

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



[issue47170] py launcher on windows opens new terminal window when parsing python script with shebang

2022-03-30 Thread Christian Ascia


Christian Ascia  added the comment:

It happens when i run "my-script.py".
I checked all terminal emulators on my system, it happens on PowerShell 7, in 
all Windows Terminal profiles (including cmd profile), in integrated terminals 
on vscode but not in cmd.

--

___
Python tracker 

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



[issue47170] py launcher on windows opens new terminal window when parsing python script with shebang

2022-03-30 Thread Paul Moore


Paul Moore  added the comment:

This is Windows (shell) behaviour. To avoid this, you need to add the .py 
extension to the PATHEXT environment variable.

--

___
Python tracker 

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



[issue47170] py launcher on windows opens new terminal window when parsing python script with shebang

2022-03-30 Thread Christian Ascia


Christian Ascia  added the comment:

Thanks, it works now!

--
resolution:  -> fixed
stage:  -> 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



[issue47171] Enable py.exe install in Windows ARM64 installer

2022-03-30 Thread Steve Dower


New submission from Steve Dower :

Currently the launcher is not installed by the installer. We need to reenable 
it.

--
assignee: steve.dower
components: Windows
messages: 416385
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Enable py.exe install in Windows ARM64 installer
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



[issue47168] Improvements for stable ABI definition files

2022-03-30 Thread Oleg Iarygin


Change by Oleg Iarygin :


--
nosy: +arhadthedev

___
Python tracker 

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



[issue47172] Make virtual opcodes in the compiler > 256 and is_jump() identify only proper jumps

2022-03-30 Thread Irit Katriel


New submission from Irit Katriel :

There are a few "virtual opcodes" which are internal to the compiler. They can 
have values > 256. This way we don't waste any valid opcodes on them, and it is 
easier to detect when one of them escapes the compiler into the assemble stage.

In addition, there is an is_jump() function that treats the exception handling 
opcodes as jumps (and also assumes that any opcode >= SETUP_WITH is a jump):

static inline int
 is_jump(struct instr *i)
 {
return i->i_opcode >= SETUP_WITH || is_bit_set_in_table(_PyOpcode_Jump, 
i->i_opcode);
 }

Then there is is_block_push just for the three virtual exception block opcodes:

static inline int
is_block_push(struct instr *instr)
{
int opcode = instr->i_opcode;
return opcode == SETUP_FINALLY || opcode == SETUP_WITH || opcode == 
SETUP_CLEANUP;
}

We can make is_jump return true just for jumps, and call is_block_push as well 
when it is needed (currently sometimes we call is_jump when there cannot be 
virtual opcodes anymore so we can assert that instead, and in one place we call 
is_jump and then exclude the virtual opcodes. Both of these will become clearer 
after we make this change).

--
assignee: iritkatriel
components: Interpreter Core
messages: 416386
nosy: iritkatriel
priority: normal
severity: normal
status: open
title: Make virtual opcodes in the compiler > 256 and is_jump() identify only 
proper jumps
type: enhancement
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



[issue46775] [Windows] OSError should unconditionally call winerror_to_errno

2022-03-30 Thread Steve Dower


Steve Dower  added the comment:


New changeset d0c67ea0645b7ad37b867c167882a346a24de641 by Dong-hee Na in branch 
'main':
bpo-46775: OSError should call winerror_to_errno unconditionally on Windows 
(GH-32179)
https://github.com/python/cpython/commit/d0c67ea0645b7ad37b867c167882a346a24de641


--

___
Python tracker 

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



[issue46775] [Windows] OSError should unconditionally call winerror_to_errno

2022-03-30 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +30275
pull_request: https://github.com/python/cpython/pull/32198

___
Python tracker 

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



[issue46775] [Windows] OSError should unconditionally call winerror_to_errno

2022-03-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +30276
pull_request: https://github.com/python/cpython/pull/32199

___
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-03-30 Thread Oleg Iarygin


Oleg Iarygin  added the comment:

Probably, `regen-limited-abi` needs to be called from `regen-all` so 'Check if 
generated files are up to date' CI job will become aware of it.

--

___
Python tracker 

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



[issue47172] Make virtual opcodes in the compiler > 256 and is_jump() identify only proper jumps

2022-03-30 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue47173] test_launcher fails on win-arm64 buildbot

2022-03-30 Thread Steve Dower


New submission from Steve Dower :

Test failures: https://buildbot.python.org/all/#/builders/730/builds/4307

==
FAIL: test_filter_to_company (test.test_launcher.TestLauncher)
--
Traceback (most recent call last):
  File 
"C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\Lib\test\test_launcher.py",
 line 311, in test_filter_to_company
self.assertEqual("X.Y.exe", data["LaunchCommand"])
^^
AssertionError: 'X.Y.exe' != 
'C:\\Workspace\\buildarea\\venv_310\\Scripts\\python.exe'
- X.Y.exe
+ C:\Workspace\buildarea\venv_310\Scripts\python.exe
==
FAIL: test_py_default (test.test_launcher.TestLauncher)
--
Traceback (most recent call last):
  File 
"C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\Lib\test\test_launcher.py",
 line 370, in test_py_default
self.assertEqual("PythonTestSuite", data["SearchInfo.company"])
^^^
AssertionError: 'PythonTestSuite' != '(null)'
- PythonTestSuite
+ (null)
==
FAIL: test_py_shebang (test.test_launcher.TestLauncher)
--
Traceback (most recent call last):
  File 
"C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\Lib\test\test_launcher.py",
 line 392, in test_py_shebang
self.assertEqual("PythonTestSuite", data["SearchInfo.company"])
^^^
AssertionError: 'PythonTestSuite' != '(null)'
- PythonTestSuite
+ (null)

--
components: Windows
messages: 416389
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: test_launcher fails on win-arm64 buildbot
type: behavior
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



[issue47173] test_launcher fails on win-arm64 buildbot

2022-03-30 Thread Steve Dower


Steve Dower  added the comment:

Oh, I wonder if the VIRTUAL_ENV environment variable is interfering with search 
(as it's meant to, but the tests weren't written expecting to be run inside a 
venv).

--

___
Python tracker 

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



[issue47172] Make virtual opcodes in the compiler > 256 and is_jump() identify only proper jumps

2022-03-30 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher

___
Python tracker 

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



[issue44090] Add class binding to unbound super objects for allowing autosuper with class methods

2022-03-30 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yeah, I see no description of what you can do with an unbound super object in 
the docs (https://docs.python.org/3/library/functions.html#super), and 
experimentation with it does not reveal any useful functionality.

You may want to open a new issue for this, and we'll probably have to propose a 
2-release deprecation period and start issuing a deprecation warning, in case 
there are nevertheless users (like autosuper clones).

--

___
Python tracker 

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



[issue47171] Enable py.exe install in Windows ARM64 installer

2022-03-30 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue47174] Define behavior of descriptor-typed fields on dataclasses

2022-03-30 Thread Erik De Bonte

New submission from Erik De Bonte :

Recent discussions about PEP 681 (dataclass_transform) have focused on support 
for descriptor-typed fields. See the email thread here: 
https://mail.python.org/archives/list/typing-...@python.org/thread/BW6CB6URC4BCN54QSG2STINU2M7V4TQQ/

Initially we were thinking that dataclass_transform needed a new parameter to 
switch between two modes. In one mode, it would use the default behavior of 
dataclass. In the other mode, it would be smarter about how descriptor-typed 
fields are handled. For example, __init__ would pass the value for a 
descriptor-typed field to the descriptor's __set__ method. However, Carl Meyer 
found that dataclass already has the desired behavior at runtime! We missed 
this because mypy and Pyright do not correctly mirror this runtime behavior.

Although this is the current behavior of dataclass, I haven't found it 
documented anywhere and the behavior is not covered by unit tests. Since 
dataclass_transform wants to rely on this behavior and the behavior seems 
desirable for dataclass as well, I'm proposing that we add additional dataclass 
unit tests to ensure that this behavior does not change in the future.

Specifically, we would like to document (and add unit tests for) the following 
behavior given a field whose default value is a descriptor:

1. The value passed to __init__ for that field is passed to the descriptor’s 
__set__ method, rather than overwriting the descriptor object.

2. Getting/setting the value of that field goes through __get__/__set__, rather 
than getting/overwriting the descriptor object.

Here's an example:

class Descriptor(Generic[T]):
def __get__(self, __obj: object | None, __owner: Any) -> T:
return getattr(__obj, "_x")

def __set__(self, __obj: object | None, __value: T) -> None:
setattr(__obj, "_x", __value)

@dataclass
class InventoryItem:
quantity_on_hand: Descriptor[int] = Descriptor[int]()

i = InventoryItem(13) # calls __set__ with 13
print(i.quantity_on_hand) # 13 -- obtained via call to __get__
i.quantity_on_hand = 29   # calls __set__ with 29
print(i.quantity_on_hand) # 29 -- obtained via call to __get__

I took a first stab at unit tests here: 
https://github.com/debonte/cpython/commit/c583e7c91c78c4aef65a1ac69241fc06ad95d436

We are aware of two other descriptor-related behaviors that may also be worth 
documenting:

First, if a field is annotated with a descriptor type but is *not* assigned a 
descriptor object as its default value, it acts like a non-descriptor field. 
Here's an example:

@dataclass
class InventoryItem:
quantity_on_hand: Descriptor[int] # No default value

i = InventoryItem(13)  # Sets quantity_on_hand to 13 -- No call to 
Descriptor.__set__
print(i.quantity_on_hand)  # 13 -- No call to Descriptor.__get__

And second, when a field with a descriptor object as its default value is 
initialized (when the code for the dataclass is initially executed), __get__ is 
called with a None instance and the return value is used as the field's default 
value. See the example below. Note that if __get__ doesn't handle this None 
instance case (for example, in the initial definition of Descriptor above), a 
call to InventoryItem() fails with "TypeError: InventoryItem.__init__() missing 
1 required positional argument: 'quantity_on_hand'".

I'm less sure about documenting this second behavior, since I'm not sure what 
causes it to work, and therefore I'm not sure how intentional it is.

class Descriptor(Generic[T]):
def __init__(self, *, default: T):
self._default = default

def __get__(self, __obj: object | None, __owner: Any) -> T:
if __obj is None:
return self._default

return getattr(__obj, "_x")

def __set__(self, __obj: object | None, __value: T) -> None:
if __obj is not None:
setattr(__obj, "_x", __value)

# When this code is executed, __get__ is called with __obj=None and the
# returned value is used as the default value of quantity_on_hand.
@dataclass
class InventoryItem:
quantity_on_hand: Descriptor[int] = Descriptor[int](default=100)

i = InventoryItem()   # calls __set__ with 100
print(i.quantity_on_hand) # 100 -- obtained via call to __get__

--
components: Library (Lib)
messages: 416392
nosy: JelleZijlstra, debonte, eric.smith
priority: normal
severity: normal
status: open
title: Define behavior of descriptor-typed fields on dataclasses
type: enhancement
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



[issue46775] [Windows] OSError should unconditionally call winerror_to_errno

2022-03-30 Thread Steve Dower


Steve Dower  added the comment:

I'm still not convinced we should backport. Has anyone looked through to see 
whether this will actually affect any high valued error codes today?

--

___
Python tracker 

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



[issue47162] Add call trampoline to work around bad fpcasts on Emscripten

2022-03-30 Thread Christian Heimes


Change by Christian Heimes :


--
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



[issue47162] Add call trampoline to work around bad fpcasts on Emscripten

2022-03-30 Thread miss-islington


miss-islington  added the comment:


New changeset 581c4434de62d9d36392f10e65866c081fb18d71 by Christian Heimes in 
branch 'main':
bpo-47162: Add call trampoline to mitigate bad fpcasts on Emscripten (GH-32189)
https://github.com/python/cpython/commit/581c4434de62d9d36392f10e65866c081fb18d71


--
nosy: +miss-islington

___
Python tracker 

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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-30 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +30279
pull_request: https://github.com/python/cpython/pull/32204

___
Python tracker 

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



[issue47173] test_launcher fails on win-arm64 buildbot

2022-03-30 Thread Steve Dower


Steve Dower  added the comment:

The fix in PR 32204 also clears out VIRTUAL_ENV, so that may be enough. It's 
running on buildbots to see whether it helps.

--

___
Python tracker 

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



[issue47146] PR check "Check if generated files are up to date" failing intermittently

2022-03-30 Thread Christian Heimes


Christian Heimes  added the comment:

The problem is likely a recursive make call "$(MAKE)" in combination with 
parallel execution. As far as I understand it, GNU make cannot track 
dependencies properly, which can lead to partial or invalid dependency graphs. 
One make process can modify a file while another uses the file. The permission 
error or ETXTBSY error are manifestation of one process creating an executable 
while another process is attempting to execve() it.

The paper https://accu.org/journals/overload/14/71/miller_2004/ explains the 
issues with recursion in great detail.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue47171] Enable py.exe install in Windows ARM64 installer

2022-03-30 Thread Steve Dower


Steve Dower  added the comment:


New changeset 2ab609dd614045f3b112ede0b0883339de784f2a by Steve Dower in branch 
'main':
bpo-47171: Enable installing the py.exe launcher on Windows ARM64 (GH-32203)
https://github.com/python/cpython/commit/2ab609dd614045f3b112ede0b0883339de784f2a


--

___
Python tracker 

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



[issue47148] sys.path.append before import the module causing module don't have doc-string?

2022-03-30 Thread Zachary Ware


Zachary Ware  added the comment:

Also cannot reproduce on Windows:

D:\issue47148_test\parent\another folder>type ..\a.py
def multiply():
"""multiply stuff"""
return 2 * 4

D:\issue47148_test\parent\another folder>type b.py
import sys
sys.path.append('..')
import a
print(a.multiply.__doc__)

D:\issue47148_test\parent\another folder>py b.py
multiply stuff


My best advice would be to try to reproduce it again yourself in a clean 
directory, and/or remove all `*.pyc` files and `__pycache__` directories from 
your project and try again, making sure you have no environment variables 
starting with `PYTHON` set.  If you still find you're having trouble, please 
reach out in the Users category of discuss.python.org.

--
stage:  -> 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



[issue46566] Support -3.11-arm64 in py.exe launcher

2022-03-30 Thread Steve Dower


Steve Dower  added the comment:


New changeset f3d5715492195fd2532fc1a5d73be07923cdf2e1 by Steve Dower in branch 
'main':
bpo-46566: Make test_launcher more robust to a variety of installs (GH-32204)
https://github.com/python/cpython/commit/f3d5715492195fd2532fc1a5d73be07923cdf2e1


--

___
Python tracker 

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



[issue47171] Enable py.exe install in Windows ARM64 installer

2022-03-30 Thread Steve Dower


Change by 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



  1   2   >