[Python-Dev] Re: Object deallocation during the finalization of Python program

2020-01-09 Thread Tim Peters
[Pau Freixes ] > Recently I've been facing a really weird bug where a Python program > was randomly segfaulting during the finalization, the program was > using some C extensions via Cython. There's nothing general that can be said that would help. These things require excruciating details to res

[Python-Dev] Re: Should we pass tstate in the VECTORCALL calling convention before making it public?

2020-01-09 Thread Victor Stinner
Le jeu. 9 janv. 2020 à 19:33, Steve Dower a écrit : > Requiring an _active_ Python thread (~GIL held) to only run on a single > OS thread is fine, but tying it permanently to a single OS thread makes > things very painful. (Of course, this isn't the only thing that makes it > painful, but if we're

[Python-Dev] Object deallocation during the finalization of Python program

2020-01-09 Thread Pau Freixes
Hi, Recently I've been facing a really weird bug where a Python program was randomly segfaulting during the finalization, the program was using some C extensions via Cython. Debugging the issue I realized that during the deallocation of one of the Python objects the deallocation function was tryi

[Python-Dev] Re: Requesting PR review on locale module

2020-01-09 Thread Cédric Krier via Python-Dev
Hi, Any chance to get this PR reviewed? It is blocking the resolution of https://bugs.tryton.org/issue8574 Thanks On 2019-11-18 06:36, Stéphane Wirtel wrote: > Hi Cedric, > > It’s my fault, I am going to check your PR for this week. I am really sorry > because I am busy with the preparation of

[Python-Dev] Re: Should we pass tstate in the VECTORCALL calling convention before making it public?

2020-01-09 Thread Steve Dower
On 09Jan2020 0429, Mark Shannon wrote: There is a one-to-one correspondence between Python threads and O/S threads. So the threadstate can, and should, be stored in a thread local variable. This is a major issue for embedders (and potentially asyncio), as it prevents integration with existing

[Python-Dev] Re: Why doesn't venv also install python3*-config?

2020-01-09 Thread Xavier de Gaye
On 1/9/20 3:18 PM, Victor Stinner wrote: Is the "ARM64" python-config (shell script) executed on the x86-64 host? A cross-compilation means that there is probably no build framework on the target platform and therefore the build configuration of the cross-compilation of Python is not very

[Python-Dev] Re: Why doesn't venv also install python3*-config?

2020-01-09 Thread Victor Stinner
Le jeu. 9 janv. 2020 à 12:11, Xavier de Gaye a écrit : > The shell script python-config has been introduced by bpo issue 16235 named > "Add python-config.sh for use during cross compilation" in order "to behave > exactly the same as python-config.py except it doesn't depend on a Python > interp

[Python-Dev] Re: Should we pass tstate in the VECTORCALL calling convention before making it public?

2020-01-09 Thread Victor Stinner
Le jeu. 9 janv. 2020 à 13:35, Mark Shannon a écrit : > Passing the thread state explicitly creates a new class of errors that > was not there before. > What happens if the tstate argument is NULL, You will likely get a crash. > or points to a different thread? No idea what will happen. If it's

[Python-Dev] Re: Differences in what lint (e.g., mypy, flake8, etc) require from new code and what Cpython uses/returns - e.g., strings with single/double quotes.

2020-01-09 Thread Michael
On 09/01/2020 13:16, Steven D'Aprano wrote: > Hi Michael, and welcome! > > > On Thu, Jan 09, 2020 at 11:37:33AM +0100, Michael wrote: > >> I am not questioning the demands of the lint checker - rather - I am >> offering my services (aka time) to work through core to make CPython >> pass it's own (I

[Python-Dev] Re: Should we pass tstate in the VECTORCALL calling convention before making it public?

2020-01-09 Thread Mark Shannon
On 08/01/2020 3:46 pm, Victor Stinner wrote: Hi, I started to modify Python internals to pass explicitly the Python thread state ("tstate") to internal C a functions: https://vstinner.github.io/cpython-pass-tstate.html Passing the thread state explicitly creates a new class of errors that w

[Python-Dev] Re: Differences in what lint (e.g., mypy, flake8, etc) require from new code and what Cpython uses/returns - e.g., strings with single/double quotes.

2020-01-09 Thread Steven D'Aprano
Hi Michael, and welcome! On Thu, Jan 09, 2020 at 11:37:33AM +0100, Michael wrote: > I am not questioning the demands of the lint checker - rather - I am > offering my services (aka time) to work through core to make CPython > pass it's own (I assume) PEP recommendations or guidelines. That woul

[Python-Dev] Re: Differences in what lint (e.g., mypy, flake8, etc) require from new code and what Cpython uses/returns - e.g., strings with single/double quotes.

2020-01-09 Thread Paul Moore
On Thu, 9 Jan 2020 at 10:42, Michael wrote: > Last year I was struggling to get some code to pass CI in pypa/packaging. > There were other issues, but one that suprised me most was learning to ALWAYS > use double quotes (") to get the code to pass the lint check (type checking). > Anything usin

[Python-Dev] Re: Why doesn't venv also install python3*-config?

2020-01-09 Thread Xavier de Gaye
On 1/8/20 5:53 PM, Victor Stinner wrote: You may get the wrong information if you pick the wrong python-config script :-( IMHO we should add a new module (problem: how should it be called? pyconfig?) The shell script python-config has been introduced by bpo issue 16235 named "Add python-conf

[Python-Dev] Differences in what lint (e.g., mypy, flake8, etc) require from new code and what Cpython uses/returns - e.g., strings with single/double quotes.

2020-01-09 Thread Michael
Hi all, Last year I was struggling to get some code to pass CI in pypa/packaging. There were other issues, but one that suprised me most was learning to ALWAYS use double quotes (") to get the code to pass the lint check (type checking). Anything using single quotes (') as string delimiters were n

[Python-Dev] Re: Why doesn't venv also install python3*-config?

2020-01-09 Thread Petr Viktorin
On 2020-01-08 17:53, Victor Stinner wrote: Hi, I dislike python-config for multiple reasons You may get the wrong information if you pick the wrong python-config script :-( IMHO we should add a new module (problem: how should it be called? pyconfig?) which could be used using "python3 -m xx