[Python-Dev] Regressions caused the recent work on ceval.c and frame objects

2021-09-19 Thread Victor Stinner
Hi, The recent optimization work on ceval.c and frame objects introduced regressions and the situation is stuck for 4 months (bpo-43760). Right now, maybe the best would be to revert the 2 commits in the 3.10 branch, to get more time in Python 3.11 development cycle to solve these issues. (1)

[Python-Dev] Re: How to decipher Windows errors on builds?

2021-09-16 Thread Victor Stinner
Hi Mark, https://bugs.python.org/issue45220 now tracks these Windows build errors. Victor On Thu, Sep 16, 2021 at 3:25 PM Mark Shannon wrote: > > Hi, > > I'm getting build errors on Windows for > https://github.com/python/cpython/pull/28386 > > The error message is: > > C:\Program Files

[Python-Dev] Re: python3.10rc2 compilation on android/termux/clang12.0.1 fails

2021-09-16 Thread Victor Stinner
Hi, On Wed, Sep 15, 2021 at 7:16 PM Sandeep Gupta wrote: > I get following warnings and errors: > Python/pytime.c:398:10: warning: implicit conversion from 'long' to 'double' > changes value from 9223372036854775807 to 9223372036854775808 > [-Wimplicit-const-int-float-conver > sion] >if

[Python-Dev] Bug fixed in the bugs.python.org OAuth-based authentication: user logged as the wrong account

2021-09-13 Thread Victor Stinner
Hi, A bug has been identified and *fixed* in the OAuth-based authentication code used on the Python bug tracker bugs.python.org (BPO) to log in with GitHub, Launchpad or Google. Under some conditions, it was possible to be logged as another person account. We are only aware of a single user

[Python-Dev] Spam from Daniel Scott

2021-09-10 Thread Victor Stinner
Hi, For 1 or 2 years, I'm getting spam messages from "Daniel Scott". It started with empty replies to multiple Python mailing lists. Mailing list owners: please block his email address. I never ever saw any useless message from this name (sorry if a real Daniel Scott plans to contribute to Python

[Python-Dev] Re: PEP 467 feedback from the Steering Council

2021-09-09 Thread Victor Stinner
I proposed bytes.byte earlier in this thread: https://mail.python.org/archives/list/python-dev@python.org/message/KBVVBJL2PHI55Y26Z4FMSCJPER242LFA/ Gregory dislikes the name: "I don't *like* to argue over names (the last stage of anything) but I do need to point out how that sounds to read".

[Python-Dev] Re: PEP 467 feedback from the Steering Council

2021-09-09 Thread Victor Stinner
Hum, it seems like this is a confusion between converting a whole bytes *string* to/from an integer, and converting a single *character* to/from an integer. I propose to rename PEP 467 method bytes.fromint(n) to => bytes.fromchar(n) <= to convert an integer to a single *character*: it fails if n

[Python-Dev] Re: PEP 467 feedback from the Steering Council

2021-09-08 Thread Victor Stinner
On Wed, Sep 8, 2021 at 7:46 AM Steven D'Aprano wrote: > >>> bytes.from_int(121404708502361365413651784, 'little') > # should return b'Hello world' Really? I don't know anyone serializing strings as a "bigint" number. Did you already see such code pattern in the wild? Usually, bytes are

[Python-Dev] Re: deprecated-removed

2021-09-08 Thread Victor Stinner
Hi Serhiy, For me, "deprecated" should be used if the removal is *not* planned: the feature is too popular, and removing it would break too much 3rd party code. "deprecated-removal" should be used if the feature removal *is* planned. IMO it's ok if we forget to remove the feature and keep it

[Python-Dev] Re: Making code object APIs unstable

2021-09-06 Thread Victor Stinner
Oh, I didn't know this *existing* C API function: PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno) So Cython could be modified to use it, no? Victor On Tue, Sep 7, 2021 at 12:44 AM Guido van Rossum wrote: > > On Fri, Sep 3, 2021 at 4:12 PM Victor Stinner

[Python-Dev] Re: Making code object APIs unstable

2021-09-03 Thread Victor Stinner
On Thu, Sep 2, 2021 at 11:15 PM Guido van Rossum wrote: > FWIW I've applied for an exception from the two-release deprecation policy > from the SC: > https://github.com/python/steering-council/issues/75 On the PyPI top 5000 packages, 136 contain "PyCode" in the source. I didn't check how many

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Victor Stinner
I saw Python projects injecting fake frames for XML and JSON parsers, maybe also configuration file (.ini?) parsers. So text files which have line numbers ;-) On Wed, Sep 1, 2021 at 7:33 PM Pablo Galindo Salgado wrote: > I don't think we should think on those terms. We certainly don't want to be

[Python-Dev] Re: Making code object APIs unstable

2021-09-01 Thread Victor Stinner
If creating a fake frame is a common use case, we can maybe write a public C API for that. For example, I saw parser injecting frames to show the file name and line number of the parsed file in the traceback. Victor On Wed, Sep 1, 2021 at 4:07 AM Stefan Behnel wrote: > > Guido van Rossum

[Python-Dev] Re: Is anyone relying on new-bugs-announce/python-bugs-list/bugs.python.org summaries

2021-08-30 Thread Victor Stinner
Hi Ammar, On Tue, Aug 24, 2021 at 12:17 AM Ammar Askar wrote: > 1. Weekly summary emails with bug counts and issues from the week, > example: > https://mail.python.org/archives/list/python-dev@python.org/thread/JRFJ4QH7TR35HFRQWOYPPCGOYRFAXK24/ These emails annoy me. I learnt to mark them as

[Python-Dev] Re: A ban from Core Developer spaces.

2021-08-27 Thread Victor Stinner
Hi, I collected past events about bans and code of conduct incidents in the Python community: https://pythondev.readthedocs.io/diversity.html#python-code-of-conduct-bans It may help some people to see how bans and incidents are handled in Python. See also the

[Python-Dev] Re: My apologies to the list

2021-08-27 Thread Victor Stinner
Hi Antoine, I have an alternative to GMane. I'm using a different email address for anything related to Python (and OSS projects in general): python-dev list, bug tracker, buildbots, GitHub notifications, etc. Some days, I don't read this email account at all, but I can still read my personal and

[Python-Dev] Re: Making code object APIs unstable

2021-08-17 Thread Victor Stinner
Since Cython is a common consumer of this C API, can somone please dig into Cython to see exactly what it needs in terms of API? How does Cython create all arguments of the __Pyx_PyCode_New() macro? Does it copy an existing function to only override some fields, something like

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-17 Thread Victor Stinner
See also: * https://bugs.python.org/issue44881 "Consider integration of PyObject_GC_UnTrack() with the trashcan C API". * https://bugs.python.org/issue44897 "Integrate trashcan mechanism into _Py_Dealloc" The issue44897 would make all these macros useless ;-) Victor

[Python-Dev] Re: Deprecate Py_TRASHCAN_SAFE_BEGIN/END in 3.10?

2021-08-17 Thread Victor Stinner
ve > different signatures) called simply Py_TRASHCAN_BEGIN and Py_TRASHCAN_END. > - by that time there was already a follow-up PR open (GH-12607) to improve > backwards compatibility of the macros, as well as introduce tests for them; > this was never merged. > - in Feb 2020 (0f

[Python-Dev] Re: [python-committers] Roundup to GitHub Issues migration

2021-08-05 Thread Victor Stinner
Hi Ezio, What is the status of the migration of Python issues from bugs.python.org (Roundup) to GitHub? Is it still a work-in-progress or is it stalled? Victor On Mon, Jun 21, 2021 at 4:20 AM Ezio Melotti wrote: > > As you might know, PEP 581 (Using GitHub Issues for CPython) has been >

[Python-Dev] Re: Python3 OSF/1 support?

2021-08-04 Thread Victor Stinner
Hi, I suggest you to start by forking the python/cpython repository and keep your changes in a branch. You can share it on a website, maybe with a tarball including your patches. If it gets enough popularity, maybe we can consider later to include these changes. Since Alpha hardware is not

[Python-Dev] Re: Repealing PEP 509 (Add a private version to dict)

2021-08-04 Thread Victor Stinner
Hi, I wrote the PEP 509 as part of my abandonned "FAT Python" project which was a ahead-of-time optimizer using runtime guards to deoptimize code. I planed to abandon this PEP as well, but the dictionary version was used by LOAD_GLOBAL opcode cache which made the version useful and so the PEP was

[Python-Dev] Re: Windows buildbots may be broken

2021-08-04 Thread Victor Stinner
Hi Jason, One month ago, I changed the Buildbot configuration: --- Use Git "fresh" method Git "clean" method keeps most files created by a previous build. Use Git "fresh" method instead to ignores .gitignore rules and so remove all generated files (like ".o" files): run a fresh build rather than

[Python-Dev] Re: PEP 467 feedback from the Steering Council

2021-08-04 Thread Victor Stinner
On Tue, Aug 3, 2021 at 7:54 PM Ethan Furman wrote: > I would rather keep `bchr` and lose the `.fromint()` methods. I would prefer to only have a bytes.byte(65) method, no bchr() built-in function. I would prefer to keep builtins namespace as small as possible. bytes.byte() name is similar to

[Python-Dev] Re: Does anyone use threading debug PYTHONTHREADDEBUG=1 env var? Can I remove it?

2021-07-08 Thread Victor Stinner
ry itself. (Evidenced by it only working on --with-pydebug, > which is for when you're debugging CPython itself, not any user apps.) > > On Wed, Jul 7, 2021 at 9:33 AM Gregory P. Smith wrote: >> >> >> >> On Wed, Jul 7, 2021 at 2:28 AM Victor Stinner wrote: >>&

[Python-Dev] Does anyone use threading debug PYTHONTHREADDEBUG=1 env var? Can I remove it?

2021-07-07 Thread Victor Stinner
Hi, Does anyone use threading debug PYTHONTHREADDEBUG=1 env var on a Python debug build? If not, can I just remove it? -- To fix a race condition at thread exit on Linux using the glibc, I removed calls to pthread_exit() (PyThread_exit_thread()) in the _thread module:

[Python-Dev] Re: Is the Python review process flawed?

2021-07-01 Thread Victor Stinner
Thanks Brian for your nice summary! Let me complete it. Warning: I didn't look at https://github.com/python/cpython/pull/4819 at all. My email is a really general remark on the Python workflow. You in this email is not the OP, but "any contributor" ;-) What contributors don't see is that

[Python-Dev] Re: Roundup to GitHub Issues migration

2021-06-21 Thread Victor Stinner
Hi, As a bug triager, it's very frustrating when I ask for more information about a bug, and I get no reply. Usually, such bug is closed as "out of date" (lack enough information to be debugged). The requirement for a GitHub account was well known when PEP 581 was accepted. The PEP was approved.

[Python-Dev] Re: Difficulty of testing beta releases now available

2021-06-11 Thread Victor Stinner
tools/cythonize.py ] Victor On Fri, Jun 11, 2021 at 4:30 PM Victor Stinner wrote: > > Hi, > > On Wed, May 26, 2021 at 2:05 AM Neil Schemenauer > wrote: > > - Cython doesn't work because of _PyGen_Send change [1] > > My team fixed the Python 3.10 compatibility

[Python-Dev] Re: Difficulty of testing beta releases now available

2021-06-11 Thread Victor Stinner
Hi, On Wed, May 26, 2021 at 2:05 AM Neil Schemenauer wrote: > - Cython doesn't work because of _PyGen_Send change [1] My team fixed the Python 3.10 compatibility in the Cython 0.29.x branch, but the latest 0.29.x release (0.29.23, April 14, 2021) doesn't include these fixes yet. A new Cython

[Python-Dev] Re: Making PY_SSIZE_T_CLEAN not mandatory.

2021-06-09 Thread Victor Stinner
On Wed, Jun 9, 2021 at 10:32 AM Ronald Oussoren via Python-Dev wrote: > Its a bit late to complain (and I’m not affected by this myself), but those > functions are part of the stable ABI. The change in 3.10 will break any > extensions that use the stable ABI, use these functions and don’t use

[Python-Dev] Re: Proposal: declare "unstable APIs"

2021-06-04 Thread Victor Stinner
On Fri, Jun 4, 2021 at 12:29 AM Guido van Rossum wrote: >> In the C API, there is the internal C API which fits with your >> description. To access it, you have to declare the >> Py_BUILD_CORE_MODULE macro. It's not usable directly on purpose. It's >> an user agreement: I know what I am doing,

[Python-Dev] Re: Proposal: declare "unstable APIs"

2021-06-03 Thread Victor Stinner
Hi Guido, It seems like you are talking about the Python API. In the C API, there is the internal C API which fits with your description. To access it, you have to declare the Py_BUILD_CORE_MODULE macro. It's not usable directly on purpose. It's an user agreement: I know what I am doing, and I

[Python-Dev] Re: New pythoncapi_compat project adding Python 3.10 support to your C extensions without losing Python 2.7-3.9 support

2021-06-02 Thread Victor Stinner
On Thu, Jun 3, 2021 at 2:30 AM Joannah Nanjekye wrote: > Is HPy ready yet given IIRC, there is no even first release yet? I stand to > be corrected. > I reckon it will still go through a period of incompatible changes for some > time/months too. HPy is a great project, but even if 90% of top

[Python-Dev] New pythoncapi_compat project adding Python 3.10 support to your C extensions without losing Python 2.7-3.9 support

2021-06-02 Thread Victor Stinner
Hi, What do you think of promoting the pythoncapi_compat project that I'm introducing below in the "C API: Porting to Python 3.10" section of What's New In Python 3.10? Should this project be moved under the GitHub psf organization to have a more "future proof" URL? I would like to promote this

[Python-Dev] Re: Need help to debug a ssl crash on Windows which prevents merging PRs

2021-06-01 Thread Victor Stinner
On Fri, May 28, 2021 at 6:40 PM Victor Stinner wrote: > In the 3.10 branch, it became really hard to merge PRs because the > following ssl crashs on Windows: > https://bugs.python.org/issue44252 Update on this bug which blocked the Python 3.10 beta 2 release. It's now fu

[Python-Dev] Need help to debug a ssl crash on Windows which prevents merging PRs

2021-05-28 Thread Victor Stinner
Hi, In the 3.10 branch, it became really hard to merge PRs because the following ssl crashs on Windows: https://bugs.python.org/issue44252 It has a failure rate 1/2 (on average) on the "Windows x86" and "Windows x64" jobs of GitHub Action and on the Win32 and Win64 jobs of the Azure Pipelines. I

[Python-Dev] Re: PEP 659: Specializing Adaptive Interpreter

2021-05-27 Thread Victor Stinner
Hi, The gilectomy was mentioned earlier in the thread. This project was created by a core dev who had the permission to push directly his work into the development branch, but it was done on a work. Another optimization project example was my experimental "FAT Python" project. The main idea was

[Python-Dev] Re: IRC #python-dev channel is now on Libera Chat (bye bye Freenode)

2021-05-26 Thread Victor Stinner
at 12:46 PM Victor Stinner wrote: > > Hi, > > The #python-dev IRC channel moves from Freenode to Libera Chat: > https://libera.chat/ I'm connected as vstinner, see you there ;-) Join > the channel if you would like to talk about the development of Python > itself (the VM,

[Python-Dev] IRC #python-dev channel is now on Libera Chat (bye bye Freenode)

2021-05-26 Thread Victor Stinner
Hi, The #python-dev IRC channel moves from Freenode to Libera Chat: https://libera.chat/ I'm connected as vstinner, see you there ;-) Join the channel if you would like to talk about the development of Python itself (the VM, bytecode, stdlib, etc.)! Moreover, bots notifications (GitHub,

[Python-Dev] Re: Implementing async enumerate

2021-05-25 Thread Victor Stinner
Hi, I suggest to put such function in a Python module and publish it on PyPI. I'm sure that the module will quickly grow with more async flavor of existing functions. Victor On Tue, May 25, 2021 at 4:22 AM Filipe Alves Caixeta wrote: > > Hello, > > Python 3.10 comes with the built-in anext()

[Python-Dev] Re: GDB not breaking at the right place

2021-05-24 Thread Victor Stinner
t have to > debug C code. (I know that was the case when we introduced it, decades ago.) > If that's not the goal, then what is --py-debug used for? > > On Mon, May 24, 2021 at 3:35 AM Victor Stinner wrote: >> >> "Debugging" means many things. Python is buil

[Python-Dev] Re: GDB not breaking at the right place

2021-05-24 Thread Victor Stinner
"Debugging" means many things. Python is built with -Og because it makes Python faster than -O0, and most developers debug Python code, not C code (in gdb). If you don't need to go up to the gdb/lldb level, -Og is fine. It would even make sense to build Python with -O3 in debug mode if you don't

[Python-Dev] Re: GDB not breaking at the right place

2021-05-22 Thread Victor Stinner
I strongly suggest to only build Python with -O0 when using gdb. -Og enables too many optimizations which makes gdb less usable. Victor ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org

[Python-Dev] Re: The repr of a sentinel

2021-05-20 Thread Victor Stinner
IMO you should consider writing a PEP to enhance sentinels in Python, and maybe even provide a public API for sentinels in general. Victor ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org

[Python-Dev] Re: The repr of a sentinel

2021-05-14 Thread Victor Stinner
Hi Tal, Would it make sense to have an unique singleton for such sentinel, a built-in singleton like None or Ellipsis? I propose the name "Sentinel". Sentinel would be similar to None, but the main property would be that "Sentinel is None" is false :-) The stdlib contains tons of sentinels: *

[Python-Dev] Re: [python-committers] [Release manager team communication] master blocked until 3.10 beta 1 is released

2021-05-03 Thread Victor Stinner
Hi, Please don't attempt to merge PRs until the GitHub issue described below is solved ;-) Pablo renamed the default "master" branch to "main" (in a live Twitch stream ;-)) but got a GitHub internal error! Maybe it's because the dialog announced that 1.4k+ pull requests and 700+ repositositories

[Python-Dev] Re: In what tense should the changelog be written?

2021-04-30 Thread Victor Stinner
By the way, https://docs.python.org/dev/whatsnew/3.10.html#improved-modules is inconsistent: "asyncio: Added missing ..." versus "base64: Add base64.b32hexencode() ..." You can also find such inconsistencies in "versionchanged" markups. Victor On Fri, Apr 30, 2021 at 5:01 AM Larry Hastings

[Python-Dev] Re: In what tense should the changelog be written?

2021-04-30 Thread Victor Stinner
On Fri, Apr 30, 2021 at 6:57 AM Larry Hastings wrote: > Your NEWS entry should be written in the present tense, and should start with > a verb: > > Add foo [...] > Change bar [...] > Remove bat [...] > Fix buffalo.spam [...] You might suggest using "now" when describing a behavior change: "foo

[Python-Dev] Re: In what tense should the changelog be written?

2021-04-30 Thread Victor Stinner
On Fri, Apr 30, 2021 at 6:22 AM Guido van Rossum wrote: > There’s something in the dev guide, but not about tense. Worth adding. (My > pet peeve is not to write “The foo module resets the bar state when spam > happens,” because that isn’t clear about whether that’s the before or after >

[Python-Dev] Re: Existing asyncio features scheduled for removal in Python 3.9 and 3.10

2021-04-27 Thread Victor Stinner
Hi, On Mon, Apr 26, 2021 at 10:51 PM Illia Volochii wrote: > There are a couple of uncompleted asyncio feature removals scheduled > for 3.9 and 3.10 releases. > It will be great if we either complete them or reschedule before the > 3.10 feature freeze. There are two stale pull requests related

[Python-Dev] Re: Should Python typing leverage PEP 263 as a pre-processor step?

2021-04-20 Thread Victor Stinner
I proposed PEP 511 "API for code transformers" for Python 3.6 (in 2016) and it was rejected: https://www.python.org/dev/peps/pep-0511/#rejection-notice """ This PEP was rejected by its author. This PEP was seen as blessing new Python-like programming languages which are close but incompatible

[Python-Dev] Re: Question regarding the value of PyThreadState.thread_id

2021-04-17 Thread Victor Stinner
Hi, There are two reasons: * PyThread_get_thread_native_id() was only added recently (Python 3.8) * PyThread_get_thread_native_id() is not portable and not available on all platforms: the function is only declared if the PY_HAVE_THREAD_NATIVE_ID macro is defined. Maybe PyThreadState.thread_id

[Python-Dev] Re: How about using modern C++ in development of CPython ?

2021-04-16 Thread Victor Stinner
Hi, I used C++ in the past to write a small game. My experience was that the compilation was quite slow and many compiler errors were hard to understand. I love the fact the CPython is written in C because its build time is under one minute for a fresh build, and way faster for an incremental

[Python-Dev] Re: Can we change python -W option and PYTHONWARNINGS to use a regex for the message?

2021-04-16 Thread Victor Stinner
/issue34624 Victor On Fri, Apr 16, 2021 at 3:22 PM Ivan Pozdeev via Python-Dev wrote: > > It'll probably be easier to change the warnings filter semantic > (https://docs.python.org/3/library/warnings.html#the-warnings-filter) > to which those values are directly passed. > > On 16.04.

[Python-Dev] Can we change python -W option and PYTHONWARNINGS to use a regex for the message?

2021-04-16 Thread Victor Stinner
Hi, I propose to change the -W command line option and the PYTHONWARNINGS environment variable to use the message as a regular expression in Python 3.10. Or does anyone have a reason to keep the current behavior as it is? I created https://bugs.python.org/issue43862 for this change. -- Python

[Python-Dev] Re: gzip.py: allow deterministic compression (without time stamp)

2021-04-15 Thread Victor Stinner
, the Python stdlib already uses it in compileall and py_compile modules. Victor On Thu, Apr 15, 2021 at 12:34 PM Antoine Pitrou wrote: > > On Thu, 15 Apr 2021 11:28:03 +0200 > Victor Stinner wrote: > > If gzip is modified to use SOURCE_DATE_EPOCH timestamp, you get a > >

[Python-Dev] Re: Revive PEP 396 -- Module Version Numbers ?

2021-04-15 Thread Victor Stinner
Paul Bryan: > Seems like this is something that should make its way into stdlib? In the last 10 years, the trend is more to remove anything related to packaging *outside* the stdlib :-) Since it's evolving way faster than Python releases and the stdlib cannot be updated once installed, I don't

[Python-Dev] Re: gzip.py: allow deterministic compression (without time stamp)

2021-04-15 Thread Victor Stinner
If gzip is modified to use SOURCE_DATE_EPOCH timestamp, you get a reproducible binary and you don't need to add a new constant ;-) SOURCE_DATE_EPOCH is a timestamp: number of seconds since Unix Epoch (January 1, 1970 at 00:00). Victor On Wed, Apr 14, 2021 at 8:15 PM wrote: > > The gzip

[Python-Dev] Re: gzip.py: allow deterministic compression (without time stamp)

2021-04-14 Thread Victor Stinner
Hi, gzip.NO_TIMESTAMP sounds like a good idea. But I'm not sure about changing the default behavior. I would prefer to leave it unchanged. I guess that your problem is that you don't access gzip directly, but uses a higher level API which doesn't give access to the timestamp parameter, like the

[Python-Dev] Re: Revive PEP 396 -- Module Version Numbers ?

2021-04-14 Thread Victor Stinner
On Wed, Apr 14, 2021 at 7:48 AM Christopher Barker wrote: > So what do you'all think? After thirteen years, it would be nice to put this > to bed. There are two main use cases for versions: * Display them to the user * Compare versions to check if one is newer, older or the same I dislike

[Python-Dev] Re: Boundaries between numbers and identifiers

2021-04-14 Thread Victor Stinner
Also, would it be possible to enhance to tokenizer to report a SyntaxWarning, rather than a SyntaxError? Victor ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org

[Python-Dev] Re: Boundaries between numbers and identifiers

2021-04-13 Thread Victor Stinner
It would be useful to first estimate how many projects would be broken by such incompatible change (stricter syntax). Inada-san wrote https://github.com/methane/notes/blob/master/2020/wchar-cache/download_sdist.py to download source files using https://hugovk.github.io/top-pypi-packages/ API (top

[Python-Dev] Please review the new Python Build System documentation

2021-04-12 Thread Victor Stinner
Hi, Please review this documentation: https://docs.python.org/dev/using/configure.html If you have comment, you can directly write a PR (please notify me by mentioning @vstinner in a comment). Or if you prefer, you can reply directly by email and I will try to address your remarks. --

[Python-Dev] Re: When we remove 'U' mode of open()?

2021-04-08 Thread Victor Stinner
ces in Python 3.11, after 3.10 branch is > created (and master branch is renamed to main). > > On Thu, Apr 8, 2021 at 5:45 AM Brett Cannon wrote: > > > > > > > > On Wed, Apr 7, 2021 at 10:01 AM Serhiy Storchaka > > wrote: > >> > >> 07.

[Python-Dev] Re: When we remove 'U' mode of open()?

2021-04-07 Thread Victor Stinner
Hi Inada-san, I'm +0 on removing again the flag, but I would prefer to not endorse the responsibility. I am already responsible for enough incompatible changes in Python 3.10 :-D Some context on this "U" open mode. The flag is accepted by many functions opening files. It is deprecated (emit

[Python-Dev] Re: [python-committers] NOTE: Python 3.9.3 contains an unintentional ABI incompatibility leading to crashes on 32-bit systems

2021-04-06 Thread Victor Stinner
Hi, About this very specific ABI issue, one long term solution would be to exclude the PyThreadState structure from the C API, to not rely on it the ABI level. I started to add getter functions in Python 3.9: PyThreadState_GetInterpreter(), PyThreadState_GetFrame() and PyThreadState_GetID(). I'm

[Python-Dev] Re: Weird io.OpenWrapper hack to use a function as method

2021-03-31 Thread Victor Stinner
reated @staticmethod callable. Victor On Wed, Mar 31, 2021 at 4:19 PM Ethan Furman wrote: > > On 3/31/21 6:49 AM, Victor Stinner wrote: > > > tl; dr *Maybe* staticmethod could be modified to become callable? > > There have been other requests to make staticmethod ca

[Python-Dev] Re: Weird io.OpenWrapper hack to use a function as method

2021-03-31 Thread Victor Stinner
A friend, Antoine Rozo, wrote a variant of staticmethod which is callable. With this decorator, it works in A, B and C cases: --- class simplefunction: def __init__(self, func): self.func = func def __get__(self, owner, instance): return self.func def __call__(self,

[Python-Dev] Re: Weird io.OpenWrapper hack to use a function as method

2021-03-31 Thread Victor Stinner
*Maybe* staticmethod could be modified to become callable? Victor On Wed, Mar 31, 2021 at 2:34 PM Victor Stinner wrote: > > Hi, > > The io module provides an open() function. It also provides an > OpenWrapper which only exists to be able to store open as a method > (class or insta

[Python-Dev] Weird io.OpenWrapper hack to use a function as method

2021-03-31 Thread Victor Stinner
Hi, The io module provides an open() function. It also provides an OpenWrapper which only exists to be able to store open as a method (class or instance method). In the _pyio module, pure Python implementation of the io module, OpenWrapper is implemented as: class OpenWrapper: """Wrapper for

[Python-Dev] New public C API functions must not steal references or return borrowed references

2021-03-25 Thread Victor Stinner
Hi, A new Include/README.rst file was just added to document the 3 C API provided by CPython: * Include/: Limited C API * Include/cpython/: CPython implementation details * Include/internal/: The internal API I would like to note that *new* public C API functions must no longer steal references

[Python-Dev] Re: Tests now start with only 131 imported modules, instead of 233

2021-03-23 Thread Victor Stinner
On Tue, Mar 23, 2021 at 9:04 AM Ivan Pozdeev via Python-Dev wrote: > Also, how is the now-split-off funcionality to be invoked? Does it require > two or more imports now, or it's imported on demand when one > invokes an appropriate test.support entry? By the way, splitting test.support into

[Python-Dev] Re: Tests now start with only 131 imported modules, instead of 233

2021-03-23 Thread Victor Stinner
Hi Ivan, On Tue, Mar 23, 2021 at 9:04 AM Ivan Pozdeev via Python-Dev wrote: > I didn't quite get what the big effect is. Saving 30 milliseconds? I started to dig into this issue while debugging a random crash on AIX (bpo-40091). A test_threading test using fork randomly crashed on AIX. I

[Python-Dev] Tests now start with only 131 imported modules, instead of 233

2021-03-22 Thread Victor Stinner
Hi, tl;dr Tests of the Python Test Suite now start with 131 imported modules, instead of 233. For example, asyncio, logging, multiprocessing and warnings are no longer imported by default. -- The Python test suite is run by a custom test runner called "libregrtest" (test.libregrtest). It can

[Python-Dev] Re: Non-monotonically increasing line numbers in dis.findlinestarts() output

2021-03-17 Thread Victor Stinner
Hi Skip, I modified co_lnotab format when I worked on the FAT Python optimization project which modified the AST to emit more efficient bytecode. My optimizer moved instructions, the line number could become non-monotonic (..., line 2, line 3, line 2, line 4, ...), and so lnotab (..., +1, -1, +2,

[Python-Dev] Re: Reviving PEP 473

2021-03-16 Thread Victor Stinner
For best performance (reduce time to build an exception object), I would be interested to only format the error message on demand. For example, when str(exception) is called. The problem is the Exception.args attribute. Example: $ ./python Python 3.10.0a6+ >>> exc=AttributeError("%s object has

[Python-Dev] Re: [python-committers] Accepting PEP 597 (Add optional EncodingWarning)

2021-03-15 Thread Victor Stinner
Congratulation INADA-san! I'm impressed by your tenacity :-) Last months, I followed your different propositions on discuss.python.org to use UTF-8 by default in Python. It's good to see the first non-controversial part being accepted! I hope that this PEP will help to move towards a world where

[Python-Dev] Re: Reviving PEP 473

2021-03-13 Thread Victor Stinner
Context: PEP 473 "Adding structured data to built-in exceptions" proposed in 2014. https://www.python.org/dev/peps/pep-0473/ Abstract: "Exceptions like AttributeError, IndexError, KeyError, LookupError, NameError, TypeError, and ValueError do not provide all information required by programmers to

[Python-Dev] Re: [Release management] schedule for renaming the default branch

2021-03-11 Thread Victor Stinner
Hi Serhiy, On Thu, Mar 11, 2021 at 8:33 AM Serhiy Storchaka wrote: > I have above 200 feature branches in my local repository. Will renaming > the master branch cause any problems? I don't think that you need to do anything on your machine nor on your open PRs. When I use "git switch -c

[Python-Dev] Re: Steering Council update for February

2021-03-10 Thread Victor Stinner
Hi, Could we please stick to the point of renaming a Git branch? Today, renaming a branch is easy. The rationale has been given. I don't think any argument is going to make the Steering Concil changing their mind ("the consensus was that we should do that"). If you want to help, please remain at

[Python-Dev] Re: CFLAGS_NODIST and -qalias=noansi

2021-03-08 Thread Victor Stinner
On Fri, Mar 5, 2021 at 5:47 PM Michael Felt wrote: > Fyi: using `git log` I have tried to get any clue re: CFLAGS_NODIST > and/or -qalias=noansi - but I do not seem to be skilled enough to find > that information. Try "git blame configure.ac" and search for "noansi". It was introduced in

[Python-Dev] Need help to fix known Python security vulnerabilities

2021-03-08 Thread Victor Stinner
Hi, The Python bug tracker currently has 78 open issues of the type Security. If you are looking for something to do to help the Python project, please go through the list (search for open issues with Type=security at bugs.python.org), discuss the different solutions how to address these

[Python-Dev] Re: Which thing is "Development Mode"

2021-02-26 Thread Victor Stinner
I suggest to assign a color to each development mode to distinguish them. Victor On Fri, Feb 26, 2021 at 7:50 PM Coyot Linden wrote: > > As of 3.7, there is now a python feature called Development Mode: > > https://docs.python.org/3/library/devmode.html#devmode > > Which has a confusingly

[Python-Dev] Re: Moving threadstate to thread-local storage.

2021-02-26 Thread Victor Stinner
Sure. The plan is to use __thread when possible ;-) Victor On Thu, Feb 25, 2021 at 4:58 AM 谢俊逸 via Python-Dev wrote: > > On MacOS & iOS, __thread variable is 35% faster than using > pthread_getspecific. > > getSpecific cost: 0.000649 > getTLS cost: 0.000423 > > > - (void)test { double t1 =

[Python-Dev] Re: Move support of legacy platforms/architectures outside Python

2021-02-22 Thread Victor Stinner
On Mon, Feb 22, 2021 at 12:51 PM Ivan Pozdeev via Python-Dev wrote: > IIRC I suggested earlier that buildsbots should be integrated into the PR > workflow in order to make it the contributor's rather than a core > dev's burden to fix any breakages that result from their changes. Some buildbot

[Python-Dev] Re: Deprecate support for mingw - add to PEP 11

2021-02-22 Thread Victor Stinner
pybind11 is a famous C++ extension module for Python. Yes, the Python C API is usable in C++ thanks to extern "C" { ... } being used in headers. Victor On Sun, Feb 21, 2021 at 6:59 PM Dan Stromberg wrote: > > > It looks like CPython remains 100% C, so clang becomes more attractive: >

[Python-Dev] Re: Move support of legacy platforms/architectures outside Python

2021-02-22 Thread Victor Stinner
On Mon, Feb 22, 2021 at 8:19 AM wrote: > There are zero technical reasons for what you are planning here. Multiple core developers explained how it's a maintenance burden. It has been explained in multiple different ways. > You are inflating a few lines of autoconf into a "platform support",

[Python-Dev] Re: Move support of legacy platforms/architectures outside Python

2021-02-22 Thread Victor Stinner
On Sun, Feb 21, 2021 at 8:57 PM Michał Górny wrote: > > The checker serves two purposes: > > > > 1) It gives users an opportunity to provide full PEP 11 support > > (buildbot, engineering time) for a platform. > > Does that mean that if someone offers to run the build bot for a minor > platform

[Python-Dev] Move support of legacy platforms/architectures outside Python

2021-02-21 Thread Victor Stinner
Hi, I propose to actively remove support for *legacy* platforms and architectures which are not supported by Python according to PEP 11 rules: hardware no longer sold and end-of-life operating systems. The removal should be discussed on a case by case basis, but I would like to get an agreement

[Python-Dev] Re: Security releases of CPython

2021-02-20 Thread Victor Stinner
On Thu, Feb 11, 2021 at 9:44 PM Michał Górny wrote: > I feel that vulnerability fixes do not make it to end users fast enough. I think that it's time to put that into perspective with past vulnerabilities. Ok, let me look at the timeline of the discussed vulnerability, ctypes CVE-2021-3177:

[Python-Dev] Re: PEP 597 bikeshedding: envvar / option name.

2021-02-19 Thread Victor Stinner
Environment variable names with underscore would be more readable, but IMO consistency with all existing names matters more: https://docs.python.org/dev/using/cmdline.html#environment-variables So I prefer PYTHONWARNDEFAULTENCODING env var and sys.flags.warn_default_encoding attribute names.

[Python-Dev] Re: It is really necessary to check that a object has a Py_TPFLAGS_HEAPTYPE flag?

2021-02-15 Thread Victor Stinner
On Tue, Feb 9, 2021 at 4:53 AM Kazantcev Andrey wrote: > I decided to figure out why it is impossible to change methods of built-in > types and found > ``` > if (!(type->tp_flags & Py_TPFLAGS_HEAPTYPE)) { > PyErr_Format( > PyExc_TypeError, > "can't set

[Python-Dev] Re: Security releases of CPython

2021-02-15 Thread Victor Stinner
Hi Michał, I created https://python-security.readthedocs.io/ website to track known Python vulnerabilities to help me checking if fixes are backported to all supported Python branches. I'm maintaing this list manually, it's far from being complete, and likely outdated. I also created

[Python-Dev] Re: PEP 597 bikeshedding: envvar / option name.

2021-02-15 Thread Victor Stinner
On Mon, Feb 15, 2021 at 6:31 AM Inada Naoki wrote: > * PYTHONWARNENCODING / warn_ecoding (I love this "ecoding" typo, but it's not my favorite choice ;-)) I dislike "warn_encoding" because it is too generic. An encoding? Which one? Why does anyone want to emit a warning when an encoding is

[Python-Dev] Re: Python standardization

2021-02-15 Thread Victor Stinner
See "A formal specification for the (C)Python virtual machine - Python Language Summit 2020" by Mark Shannon: https://pyfound.blogspot.com/2020/04/a-formal-specification-for-cpython.html Victor On Fri, Feb 12, 2021 at 7:40 PM Dan Stromberg wrote: > > > What would it take to create an ANSI, ECMA

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-10 Thread Victor Stinner
On Tue, Feb 9, 2021 at 9:51 PM Paul Moore wrote: > * Realistically, I'd be surprised if developers actually use such a > tool. If they were likely to do so, they could probably just as easily > locate all the uses of open() in their code, and check that way. So > I'm not sure this proposal is

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Victor Stinner
On Tue, Feb 9, 2021 at 5:51 PM Anders Munch wrote: > Victor Stinner [mailto:vstin...@python.org] wrote: > > The warning can explicitly suggest to use encoding="utf8", it should work > > in almost all cases. > > The warning should also explain how to get backwar

[Python-Dev] Re: PEP 597: Add optional EncodingWarning

2021-02-09 Thread Victor Stinner
On Tue, Feb 9, 2021 at 1:31 PM Paul Moore wrote: > If we can't provide a good recommendation > to the user on what to do, we shouldn't be warning them that what they > are currently doing is wrong. The warning can explicitly suggest to use encoding="utf8", it should work in almost all cases.

[Python-Dev] Re: Signature discrepancies between documentation and implementation

2021-02-09 Thread Victor Stinner
If there are applications relying on the parameter name, it's better to trust the Python implementation, rather than the documentation. It would be better to make these parameters positional only in the first place, but now it's too late for such backward incompatible change :-( Victor On Tue,

  1   2   3   4   5   6   7   8   9   10   >