[issue46285] protocol_version in http.server.test can be ignored

2022-01-26 Thread Hugo Almeida

Hugo Almeida  added the comment:

Hi Éric, thank you so much.

I know only a little usage of closure and functools.partial but not the 
historical/relative knowledge of their design/feature, I mean this issue have 2 
visual, the partical object not working as it expected or we are not calling 
the partical as it expected:

1) partial is not working as its feature or design said, assume I guessed 
right, thus partial object behaviors should be totally equal to its 
wrapper/inside class called with properties applied in a standalone/outside way 
which we usually used, the use of partical at http.server.test should be okey.

"""
import functools

class Obj:
pass

obj = Obj(); obj.foo = bar  # usually used
jbo = functools.partial(Obj, foo=bar)

# if jbo totally equal to obj in anywhere
# (the so called Duck Type or
# maybe the LSP rule, Liskov
# Substitution Principle)
# the use of partical in http.server
# should also be ok
#
# I used the partical times the same
# as http.server's author did
# and I told myself I know its usage
# but now I do not think so
"""

2) solve this issue itself, to pass handler class directly to ignore partial 
object caused problem, this is a coding logic shelter/fixing because the way we 
used functools.partical is not as it expected. This is what cpython@github 
PR30701 already done. (so the use of partical in http.server is not ok, not 
welcome at least, so based what I said above, the feature/design of partical 
now confused me, unless its a bug of partical itself which I am not sure.)

--

___
Python tracker 

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



[issue45560] sys.last_* not set for SyntaxErrors with IDLE

2022-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

If this is not fixed, perhaps it should be documented along with other IDLE 
differences in Running User code.

--

___
Python tracker 

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



[issue45975] Simplify some while-loops with walrus operator

2022-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

To me, the five idlelib changes make the code easier to understand.  Nick, 
please either move them into a separate PR or allow me to do so, and subject to 
manual testing, I will merge and backport.  (I requested this on the PR by 
maybe you missed it.)

If there are other plausible changes in idlelib that you would like considered, 
make a spinoff issue where we can discuss them first.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue45162] Remove old deprecated unittest features

2022-01-26 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee: gregory.p.smith -> 

___
Python tracker 

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



[issue45162] Remove old deprecated unittest features

2022-01-26 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset b50322d20337ca468f2070eedb051a16ee1eba94 by Gregory P. Smith in 
branch 'main':
bpo-45162: Revert "Remove many old deprecated unittest features" (GH-30935)
https://github.com/python/cpython/commit/b50322d20337ca468f2070eedb051a16ee1eba94


--

___
Python tracker 

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



[issue46543] Add sys._getfunc

2022-01-26 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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

___
Python tracker 

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



[issue46496] idlelib/NEWS.txt for 3.11.0 and backports

2022-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 287ceca2d62d11a8b45f6264226d984dd044e082 by Terry Jan Reedy in 
branch '3.9':
bpo-46496: news39 for bpo45296 (#30949)
https://github.com/python/cpython/commit/287ceca2d62d11a8b45f6264226d984dd044e082


--

___
Python tracker 

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



[issue46496] idlelib/NEWS.txt for 3.11.0 and backports

2022-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset b3cf525bd1c57a1d3f28fcb90bce364f0bcb2b7d by Miss Islington (bot) 
in branch '3.10':
bpo-46496: news11-10 for bpo45296 (GH-30937)
https://github.com/python/cpython/commit/b3cf525bd1c57a1d3f28fcb90bce364f0bcb2b7d


--

___
Python tracker 

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



[issue46282] return value of builtins is not clearly indicated

2022-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Steven, I am also inclined to close this.  What do you think after the 
discussion?  It is sometimes easier to clarify when we have a confused person 
present in the discussion.

--

___
Python tracker 

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



[issue45296] IDLE: Better document close and exit.

2022-01-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue45296] IDLE: Better document close and exit.

2022-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 5acaad0b3033fde6f21de6ac73681cd6cf64b1f7 by Miss Islington (bot) 
in branch '3.10':
bpo-45296: Clarify close, quit, and exit in IDLE (GH-30936) (GH-30944)
https://github.com/python/cpython/commit/5acaad0b3033fde6f21de6ac73681cd6cf64b1f7


--

___
Python tracker 

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



[issue46496] idlelib/NEWS.txt for 3.11.0 and backports

2022-01-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +29128
pull_request: https://github.com/python/cpython/pull/30949

___
Python tracker 

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



[issue46543] Add sys._getfunc

2022-01-26 Thread Jelle Zijlstra


New submission from Jelle Zijlstra :

sys._getframe() has to create frame objects, which is relatively expensive. 
Usually the calling function object should be enough.

See https://github.com/faster-cpython/ideas/discussions/238

--
assignee: Jelle Zijlstra
components: Interpreter Core
messages: 411833
nosy: Jelle Zijlstra, Mark.Shannon
priority: normal
severity: normal
status: open
title: Add sys._getfunc
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



[issue45296] IDLE: Better document close and exit.

2022-01-26 Thread miss-islington


miss-islington  added the comment:


New changeset bc7d96ee332c8a575a453ec81367f2ad499f57d3 by Miss Islington (bot) 
in branch '3.9':
bpo-45296: Clarify close, quit, and exit in IDLE (GH-30936)
https://github.com/python/cpython/commit/bc7d96ee332c8a575a453ec81367f2ad499f57d3


--

___
Python tracker 

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



[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

> recordclass-0.16.3: lib/recordclass/_dataobject.c + code generated by Cython


I created: 
https://bitbucket.org/intellimath/recordclass/pull-requests/1/python-311-support-use-py_set_size

--

___
Python tracker 

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



[issue46496] idlelib/NEWS.txt for 3.11.0 and backports

2022-01-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 1.0 -> 2.0
pull_requests: +29127
pull_request: https://github.com/python/cpython/pull/30948

___
Python tracker 

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



[issue46496] idlelib/NEWS.txt for 3.11.0 and backports

2022-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 9f0881476e0113d3a35e0ffa96649b9276dd75c5 by Terry Jan Reedy in 
branch 'main':
bpo-46496: news11-10 for bpo45296 (GH-30937)
https://github.com/python/cpython/commit/9f0881476e0113d3a35e0ffa96649b9276dd75c5


--

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29126
pull_request: https://github.com/python/cpython/pull/30947

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45296] IDLE: Better document close and exit.

2022-01-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29124
pull_request: https://github.com/python/cpython/pull/30945

___
Python tracker 

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



[issue45296] IDLE: Better document close and exit.

2022-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset fcde0bc10ddd836b62d0a8e893d80b8c55e0ba3f by Terry Jan Reedy in 
branch 'main':
bpo-45296: Clarify close, quit, and exit in IDLE (GH-30936)
https://github.com/python/cpython/commit/fcde0bc10ddd836b62d0a8e893d80b8c55e0ba3f


--

___
Python tracker 

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



[issue45296] IDLE: Better document close and exit.

2022-01-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +29123
pull_request: https://github.com/python/cpython/pull/30944

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset ced50051bb752a7c1e616f4b0c001f37f0354f32 by Gregory Beauregard in 
branch 'main':
bpo-46539: Pass status of special typeforms to forward references (GH-30926)
https://github.com/python/cpython/commit/ced50051bb752a7c1e616f4b0c001f37f0354f32


--

___
Python tracker 

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



[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

> * scipy-1.7.3: scipy/_lib/boost/boost/python/object/make_instance.hpp

This is a vendored the Boost.org python module which has already been fixed in 
boost 1.78.0 (commit: January 2021) by:
https://github.com/boostorg/python/commit/500194edb7833d0627ce7a2595fec49d0aae2484

scipy should just update its scipy/_lib/boost copy.

--

___
Python tracker 

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



[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

> * guppy3-3.1.2: src/sets/bitset.c and src/sets/nodeset.c

I created: https://github.com/zhuyifei1999/guppy3/pull/40

--

___
Python tracker 

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



[issue45735] Promise the long-time truth that `args=list` works

2022-01-26 Thread Tim Peters


Tim Peters  added the comment:

Charliz, please do! I have no idea why Raymond just stopped. He even deleted 
his initial message here, saying "I relied on this for many years.  So, yet it 
would be nice to guarantee it :-)".

Best I can tell, nothing has changed: lots of people have relied on this 
behavior for years, and the docs should say it's fine.

--

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29122
pull_request: https://github.com/python/cpython/pull/30943

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6b491b9dc0b0fdfd1f07ea4e2151236186d8e7e6 by Victor Stinner in 
branch 'main':
bpo-40170: Remove _Py_GetAllocatedBlocks() function (GH-30940)
https://github.com/python/cpython/commit/6b491b9dc0b0fdfd1f07ea4e2151236186d8e7e6


--

___
Python tracker 

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



[issue45735] Promise the long-time truth that `args=list` works

2022-01-26 Thread Yu Zhao


Yu Zhao  added the comment:

I'd like to work on this issue recently if it's still needed.

According to suggestions in PR:https://github.com/python/cpython/pull/29437, I 
will:

* Add doc example for Thread function;
* Add some test cases for checking the validity of list args;
* Repeat the above works on multiprocessing module.

--
nosy: +CharlieZhao

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset af32b3ef1fbad3c2242627a14398320960a0cb45 by Victor Stinner in 
branch 'main':
bpo-40170: PyType_SUPPORTS_WEAKREFS() becomes a regular function (GH-30938)
https://github.com/python/cpython/commit/af32b3ef1fbad3c2242627a14398320960a0cb45


--

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29121
pull_request: https://github.com/python/cpython/pull/30942

___
Python tracker 

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



[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-01-26 Thread Eric Snow


Change by Eric Snow :


--
keywords: +patch
pull_requests: +29120
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30941

___
Python tracker 

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



[issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

These 2 tests seem to check for RecursionError. See my notes:
https://pythondev.readthedocs.io/unstable_tests.html#unlimited-recursion

--

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29119
pull_request: https://github.com/python/cpython/pull/30940

___
Python tracker 

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



[issue46498] Add new triplets for loongarch64

2022-01-26 Thread Zhang Na


Change by Zhang Na :


--
pull_requests: +29118
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30939

___
Python tracker 

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



[issue46542] test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot

2022-01-26 Thread STINNER Victor


New submission from STINNER Victor :

s390x Fedora Clang 3.x buildbot:
https://buildbot.python.org/all/#/builders/3/builds/1385

This change may be caused by this buildbot configuration change:
https://github.com/python/buildmaster-config/commit/8fbb7492d4509df074750bc1a8ea69812ff53aae

---
0:05:48 load avg: 7.72 [215/432/1] test_lib2to3 crashed (Exit code -11) -- 
running: (...)
Fatal Python error: Segmentation fault

Current thread 0x03ff94176710 (most recent call first):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py",
 line 845 in generate_matches
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py",
 line 785 in _recursive_matches
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py",
 line 786 in _recursive_matches
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py",
 line 786 in _recursive_matches
  (...)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/lib2to3/pytree.py",
 line 786 in _recursive_matches
  ...

Extension modules: _testcapi (total: 1)
---

and

---
0:06:29 load avg: 7.50 [245/432/2] test_json crashed (Exit code -11) -- 
running: (...)
Fatal Python error: Segmentation fault

Current thread 0x03ffbccf6710 (most recent call first):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/json/encoder.py",
 line 439 in _iterencode
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/json/encoder.py",
 line 325 in _iterencode_list
  (...)
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/json/encoder.py",
 line 439 in _iterencode
  ...

Extension modules: _testcapi (total: 1)
---

test.pythoninfo difference between successful build 1383 and failing build 1385:

* Py_DEBUG: No => Yes
* pymem.allocator: pymalloc => pymalloc_debug
* sysconfig[CFLAGS]: -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 
-Wall
  => sysconfig[CFLAGS]: -Wsign-compare -g -O0 -Wall

--
components: Tests
messages: 411820
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_json and test_lib2to3 crash on s390x Fedora Clang 3.x buildbot
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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +29117
pull_request: https://github.com/python/cpython/pull/30938

___
Python tracker 

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



[issue46496] idlelib/NEWS.txt for 3.11.0 and backports

2022-01-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +29116
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30937

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

In the top 5000 PyPI projects, the _PyObject_SIZE() and _PyObject_VAR_SIZE() 
functions are used by 7 projects:

* Cython-0.29.26
* frozendict-2.2.0: implement "sizeof" function, found in copies of 
Objects/dictobject.c file
* JPype1-1.3.0
* numpy-1.22.1: gentype_alloc() in numpy/core/src/multiarray/scalartypes.c.src, 
used as type tp_alloc functions
* pickle5-0.0.12
* pyobjc-core-8.2
* recordclass-0.17.1

--

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

I searched for "_PyObject_DebugMallocStats" in top 5000 PyPI projects. There is 
a single project using it: guppy3.

Extract of guppy3 src/heapy/xmemstats.c:

...
dlptr__PyObject_DebugMallocStats = 
addr_of_symbol("_PyObject_DebugMallocStats");
...
static PyObject *
hp_xmemstats(PyObject *self, PyObject *args)
{
if (dlptr__PyObject_DebugMallocStats) {
fprintf(stderr, 
"==\n");
fprintf(stderr, "Output from _PyObject_DebugMallocStats()\n\n");
dlptr__PyObject_DebugMallocStats(stderr);
}
...
}

addr_of_symbol() is implemented with dlsym() or 
GetModuleHandle(NULL)+GetProcAddress(): it searchs for the symbol in the 
current process.

--

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

I searched for "_PyGC_FINALIZED" in top 5000 PyPI projects. It seems like only 
Cython is impacted.

ddtrace and guppy3 use directly the internal C API.

== Cython 0.29.26 ==

* Cython/Compiler/ModuleNode.py: finalised_check = '!_PyGC_FINALIZED(o)'
* Cython/Compiler/ModuleNode.py: '(!PyType_IS_GC(Py_TYPE(o)) || 
!_PyGC_FINALIZED(o))')

== ddtrace 0.57.3 ==

In ddtrace/profiling/collector/stack.pyx:

IF PY_MINOR_VERSION >= 9:
# Needed for accessing _PyGC_FINALIZED when we build with 
-DPy_BUILD_CORE
cdef extern from "":
pass

== guppy3-3.1.2 ==

In src/heapy/hv.c:

#if PY_MAJOR_VERSION >= 3 && PY_MINOR_VERSION >= 9
# define Py_BUILD_CORE
/* PyGC_Head */
#  undef _PyGC_FINALIZED
#  include 
# undef Py_BUILD_CORE
#endif

--

___
Python tracker 

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



[issue45296] IDLE: Better document close and exit.

2022-01-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +29115
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30936

___
Python tracker 

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



[issue40170] [C API] Make PyTypeObject structure an opaque structure in the public C API

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

TODO:

* Macros still accessing directly PyTypeObject members:

  * PyHeapType_GET_MEMBERS()
  * PySequence_ITEM()
  * _PyObject_SIZE()
  * _PyObject_VAR_SIZE()
  * PyType_SUPPORTS_WEAKREFS()

* Try again to apply "bpo-40170: PyType_HasFeature() now always calls 
PyType_GetFlags() (GH-19378)" which has been reverted?
* Py_TYPE(obj)->tp_name is still commonly used to format error messages: see 
rejected bpo-34595

Other TODO tasks which can be addressed in follow-up issues:

* Add buffer protocol to PyType_FromSpec()
* Stdlib C extensions still define static types: see bpo-40077
* 3rd party C extensions still define static types: PEP 630 and others propose 
heap types

--

___
Python tracker 

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



[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c7af838805ddf52320bce3d5978bfdd37eed1b3a by Pablo Galindo Salgado 
in branch '3.10':
[3.10] bpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925) 
(GH-30933)
https://github.com/python/cpython/commit/c7af838805ddf52320bce3d5978bfdd37eed1b3a


--

___
Python tracker 

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



[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-26 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



[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-26 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset dafada393f9a790461430e2493ea1379e938b51a by Pablo Galindo Salgado 
in branch '3.9':
[3.9] bpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925) 
(GH-30934)
https://github.com/python/cpython/commit/dafada393f9a790461430e2493ea1379e938b51a


--

___
Python tracker 

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



[issue45162] Remove old deprecated unittest features

2022-01-26 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
pull_requests: +29114
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30935

___
Python tracker 

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



[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-26 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +29113
pull_request: https://github.com/python/cpython/pull/30934

___
Python tracker 

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



[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-26 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +29112
pull_request: https://github.com/python/cpython/pull/30933

___
Python tracker 

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



[issue38472] setup.py: GCC detection is broken when cross-compiling with a German locale

2022-01-26 Thread miss-islington


miss-islington  added the comment:


New changeset ff11effab7ae10b57719c066ee49b52d3991ead3 by Miss Islington (bot) 
in branch '3.9':
bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929)
https://github.com/python/cpython/commit/ff11effab7ae10b57719c066ee49b52d3991ead3


--

___
Python tracker 

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



[issue38472] setup.py: GCC detection is broken when cross-compiling with a German locale

2022-01-26 Thread miss-islington


miss-islington  added the comment:


New changeset 171fdf2162130bc8c748173bc8eef184b21f5a08 by Miss Islington (bot) 
in branch '3.10':
bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929)
https://github.com/python/cpython/commit/171fdf2162130bc8c748173bc8eef184b21f5a08


--

___
Python tracker 

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



[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-26 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:


New changeset f0a648152f2d8011f47cc49873438ebaf01d3f82 by Mateusz Łoskot in 
branch 'main':
bpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925)
https://github.com/python/cpython/commit/f0a648152f2d8011f47cc49873438ebaf01d3f82


--

___
Python tracker 

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



[issue45162] Remove old deprecated unittest features

2022-01-26 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith

___
Python tracker 

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



[issue45173] Remove configparser deprecations

2022-01-26 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Per 
https://mail.python.org/archives/list/python-...@python.org/thread/GJTREADEXYAETECE5JDTPYWK4WMTKYGR/
 we want to revert 
https://github.com/python/cpython/commit/1fc41ae8709e20d741bd86c2345173688a5e84b0
 for 3.11 to avoid causing pain.

per that thread and 
https://discuss.python.org/t/experience-with-python-3-11-in-fedora/12911 it 
sounds like you may be on top of filing upstream issues/PRs to get OSS projects 
to stop using the deprecated APIs.  great!  that should help this stick in 3.12.

as the commit removed several things at once, I suggest a full rollback, and 
smaller PRs for individual things if your upstream python project testing 
reveals things that nobody appears to be depending on.

--
nosy: +gregory.p.smith
priority: normal -> deferred blocker
stage: patch review -> needs patch

___
Python tracker 

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



[issue46282] return value of builtins is not clearly indicated

2022-01-26 Thread Irit Katriel


Irit Katriel  added the comment:

> "have the :ref:`default return value  of ``None``."


This sounds to me like "by default they return None but you can override this 
default".

I don't think any change to the doc makes sense here. When you state the 
obvious people wonder what they're missing.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue45162] Remove old deprecated unittest features

2022-01-26 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Per 
https://mail.python.org/archives/list/python-...@python.org/thread/GJTREADEXYAETECE5JDTPYWK4WMTKYGR/
 we want to revert this change for 3.11 as it causes adoption pain for little 
benefit.

To determine if we should proceed with this in 3.12 or future versions, run a 
stable Python with this change applied on the test suites of external projects 
to find regressions.  (many will have been addressed by then thanks to the work 
by RedHat)

and remember that those are only open source projects. Peoples internal 
codebases are full of use of these names and this will prevent upgrading until 
they take the time to address those.

There are targeted pieces of this change that may make sense to go forward with 
individually.  But it is easier to reason about after a rollback and consider 
new PRs to move those forward.

--
nosy: +gregory.p.smith
priority: normal -> deferred blocker
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open
type: enhancement -> behavior

___
Python tracker 

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



[issue38472] setup.py: GCC detection is broken when cross-compiling with a German locale

2022-01-26 Thread STINNER Victor


Change by STINNER Victor :


--
title: GCC detection in setup.py is broken -> setup.py: GCC detection is broken 
when cross-compiling with a German locale

___
Python tracker 

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



[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

The workaround for this bug is to build Python using the command:

LC_ALL=C make

rather than running:

make

--

___
Python tracker 

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



[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +29111
pull_request: https://github.com/python/cpython/pull/30932

___
Python tracker 

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



[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +29110
pull_request: https://github.com/python/cpython/pull/30931

___
Python tracker 

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



[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a9503ac39474a9cb1b1935ddf159c0d9672b04b6 by Victor Stinner in 
branch 'main':
bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929)
https://github.com/python/cpython/commit/a9503ac39474a9cb1b1935ddf159c0d9672b04b6


--

___
Python tracker 

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



[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

FYI distutils.unixccompiler has a private _is_gcc() function:

def _is_gcc(self, compiler_name):
# clang uses same syntax for rpath as gcc
return any(name in compiler_name for name in ("gcc", "g++", "clang"))

It's called with:

compiler = os.path.basename(sysconfig.get_config_var("CC"))

For example, on my Fedora 35, compiler is the string: 'gcc -pthread'. So 
_is_gcc() returns True.

--

___
Python tracker 

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



[issue46506] [Windows] wrap CreateFile to support follow_symlinks

2022-01-26 Thread Eryk Sun


Eryk Sun  added the comment:

Here's an implementation of _Py_CreateFile2() and win32_xstat_impl():


typedef struct {
DWORD type;
DWORD attributes;
DWORD reparseTag;
} _PY_CREATE_FILE_INFO;


static HANDLE
_Py_CreateFile2(LPCWSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
DWORD dwCreationDisposition,
LPCREATEFILE2_EXTENDED_PARAMETERS pCreateExParams,
BOOL traverse,
_PY_CREATE_FILE_INFO *pCreateInfo)
{
HANDLE hFile;
DWORD error;
FILE_BASIC_INFO fbi;
FILE_ATTRIBUTE_TAG_INFO fati;
BOOL openReparsePoint = FALSE;
BOOL traverseFailed = FALSE;
_PY_CREATE_FILE_INFO cfi = {0};

CREATEFILE2_EXTENDED_PARAMETERS createExParams = {
sizeof(CREATEFILE2_EXTENDED_PARAMETERS)};
if (!pCreateExParams) {
pCreateExParams = 
}

pCreateExParams->dwFileFlags |= FILE_FLAG_BACKUP_SEMANTICS;

if (pCreateExParams->dwFileFlags & FILE_FLAG_OPEN_REPARSE_POINT) {
openReparsePoint = TRUE;
} else if (!traverse) {
pCreateExParams->dwFileFlags |= FILE_FLAG_OPEN_REPARSE_POINT;
}

// Share read access if write access isn't requested because
// CreateFile2 uses the NT I/O flag FILE_DISALLOW_EXCLUSIVE.
if (!(dwDesiredAccess & (GENERIC_ALL | GENERIC_WRITE |
FILE_WRITE_DATA | FILE_APPEND_DATA))) {
dwShareMode |= FILE_SHARE_READ;
}

call_createfile:
hFile = CreateFile2(lpFileName, dwDesiredAccess, dwShareMode,
dwCreationDisposition, pCreateExParams);
error = GetLastError(); // success: 0 or ERROR_ALREADY_EXISTS
if (hFile == INVALID_HANDLE_VALUE) {
// bpo-37834: open an unhandled reparse point if traverse fails.
traverseFailed = (error == ERROR_CANT_ACCESS_FILE);
if (openReparsePoint || !(traverse && traverseFailed)) {
return INVALID_HANDLE_VALUE;
}
pCreateExParams->dwFileFlags |= FILE_FLAG_OPEN_REPARSE_POINT;
hFile = CreateFile2(lpFileName, dwDesiredAccess, dwShareMode,
dwCreationDisposition, pCreateExParams);
if (hFile == INVALID_HANDLE_VALUE) {
SetLastError(error);
return INVALID_HANDLE_VALUE;
}
error = GetLastError(); // 0 or ERROR_ALREADY_EXISTS
}

if (!pCreateInfo && (openReparsePoint || (traverse && !traverseFailed)))
{
return hFile;
}

cfi.type = GetFileType(hFile);
if (cfi.type == FILE_TYPE_UNKNOWN && GetLastError() != 0) {
error = GetLastError();
goto cleanup;
}

if (GetFileInformationByHandleEx(
hFile, FileAttributeTagInfo, , sizeof(fati))) {
cfi.attributes = fati.FileAttributes;
cfi.reparseTag = fati.ReparseTag;
} else if (GetFileInformationByHandleEx(
hFile, FileBasicInfo, , sizeof(fbi))) {
cfi.attributes = fbi.FileAttributes;
} else {
switch (GetLastError()) {
case ERROR_INVALID_PARAMETER:
case ERROR_INVALID_FUNCTION:
case ERROR_NOT_SUPPORTED:
// The file is not in a filesystem.
break;
default:
error = GetLastError();
}
goto cleanup;
}

if (cfi.attributes & FILE_ATTRIBUTE_REPARSE_POINT) {
if (IsReparseTagNameSurrogate(cfi.reparseTag)) {
if (traverseFailed) {
error = ERROR_CANT_ACCESS_FILE;
goto cleanup;
}
} else if (!openReparsePoint && !traverseFailed) {
// Always try to reparse if it's not a name surrogate.
CloseHandle(hFile);
traverse = TRUE;
pCreateExParams->dwFileFlags &= ~FILE_FLAG_OPEN_REPARSE_POINT;
goto call_createfile;
}
}

cleanup:
if (error && error != ERROR_ALREADY_EXISTS) {
CloseHandle(hFile);
hFile = INVALID_HANDLE_VALUE;
} else if (pCreateInfo) {
*pCreateInfo = cfi;
}
SetLastError(error);
return hFile;
}


static int
win32_xstat_impl(const wchar_t *path, struct _Py_stat_struct *result,
 BOOL traverse)
{
DWORD error;
BY_HANDLE_FILE_INFORMATION fileInfo;
_PY_CREATE_FILE_INFO cfi;
int retval = 0;

HANDLE hFile = _Py_CreateFile2(path, FILE_READ_ATTRIBUTES, 0,
OPEN_EXISTING, NULL, traverse, );

if (hFile == INVALID_HANDLE_VALUE) {
// Either the path doesn't exist, or the caller lacks access.
error = GetLastError();
switch (error) {
case ERROR_INVALID_PARAMETER:
// The "con" DOS device requires read or write access.
hFile = _Py_CreateFile2(path, GENERIC_READ, FILE_SHARE_READ |
FILE_SHARE_WRITE | FILE_SHARE_DELETE, OPEN_EXISTING,
NULL, traverse, );
if (hFile == INVALID_HANDLE_VALUE) {
SetLastError(error);

[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

> pickle5-0.0.12: pickle5/_pickle.c

This project is a backport targeting Python 3.7 and older. I'm not sure if it 
makes sense to update to it to Python 3.11.

It's the same for pysha3 which targets Python <= 3.5.

--

___
Python tracker 

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



[issue45476] [C API] PEP 674: Disallow using macros as l-value

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

> datatable-1.0.0.tar.gz

I created https://github.com/h2oai/datatable/pull/3231

--

___
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-01-26 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +29109
pull_request: https://github.com/python/cpython/pull/30930

___
Python tracker 

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



[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor

STINNER Victor  added the comment:

Ok, I reproduced the issue. I wrote PR 30929 to fix it.

The issue only occurs when cross-compiling Python with GCC and a German locale. 
I can reproduce the issue on Fedora 35:

$ LC_ALL=de_DE gcc -E -v
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=gcc
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Ziel: x86_64-redhat-linux
Konfiguriert mit: ../configure --enable-bootstrap 
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared 
--enable-threads=posix --enable-checking=release --enable-multilib 
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions 
--enable-gnu-unique-object --enable-linker-build-id 
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin 
--enable-initfini-array 
--with-isl=/builddir/build/BUILD/gcc-11.2.1-20211203/obj-x86_64-redhat-linux/isl-install
 --enable-offload-targets=nvptx-none --without-cuda-driver 
--enable-gnu-indirect-function --enable-cet --with-tune=generic 
--with-arch_32=i686 --build=x86_64-redhat-linux 
--with-build-config=bootstrap-lto --enable-link-serialization=1
Thread-Modell: posix
Unterst�tzte LTO-Kompressionsalgorithmen: zlib zstd
gcc-Version 11.2.1 20211203 (Red Hat 11.2.1-7) (GCC) 

The last line starts with "gcc-Version 11.2.1". Whereas the last line starts 
with "gcc version 11.2.1" with the C locale:

$ LC_ALL=C gcc -E -v
Using built-in specs.
COLLECT_GCC=gcc
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap 
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr 
--mandir=/usr/share/man --infodir=/usr/share/info 
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared 
--enable-threads=posix --enable-checking=release --enable-multilib 
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions 
--enable-gnu-unique-object --enable-linker-build-id 
--with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin 
--enable-initfini-array 
--with-isl=/builddir/build/BUILD/gcc-11.2.1-20211203/obj-x86_64-redhat-linux/isl-install
 --enable-offload-targets=nvptx-none --without-cuda-driver 
--enable-gnu-indirect-function --enable-cet --with-tune=generic 
--with-arch_32=i686 --build=x86_64-redhat-linux 
--with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.2.1 20211203 (Red Hat 11.2.1-7) (GCC)

--

___
Python tracker 

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



[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-01-26 Thread Eric Snow


Eric Snow  added the comment:

## Background ##

`_Py_Identifier` (and `_Py_IDENTIFIER()`, etc.) was added in 2011 [1][2] for 
several reasons:

* provide a consistent approach for a common optimization: caching C-string 
based string objects
* facilitate freeing those objects during runtime finalization

The solution involved using a static variable defined, using `_Py_IDENTIFIER()` 
near the code that needed the string.  The variable (a `_Py_Identifier`) would 
hold the desired C string (statically initialized) and the corresponding 
(lazily created) `PyUnicodeObject`.  The code where the `_Py_Identifier` was 
defined would then pass it to specialized versions of various C-API that would 
normally consume a C string or `PyUnicodeObject`.  Then that code would use 
either the C-string or the object (creating and caching it first if not done 
already).  This approach decentralized the caching but also provided a single 
tracking mechanism that made it easier to clean up the objects.

Over the last decade a number of changes were made, including recent changes to 
make the identifiers per-interpreter and to use a centralized cache.


[1] 
https://github.com/python/cpython/commit/afe55bba33a20f87a58f940186359237064b428f
[2] 
https://mail.python.org/archives/list/python-...@python.org/message/FRUTTE47JO2XN3LXV2J4VB5A5VILILLA/

--

___
Python tracker 

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



[issue38472] GCC detection in setup.py is broken

2022-01-26 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue46541] Replace _Py_IDENTIFIER() with statically initialized objects.

2022-01-26 Thread Eric Snow


New submission from Eric Snow :

`_Py_Identifier` has been useful but at this point there is a faster and 
simpler approach we could take as a replacement: statically initialize the 
objects as fields on `_PyRuntimeState` and reference them directly through a 
macro.

This would involve the following:

* add a `PyUnicodeObject field (not a pointer) to `_PyRuntimeState` for each 
string that currently uses `_Py_IDENTIFIER()`
* initialize each object as part of the static initializer for `_PyRuntimeState`
* make each "immortal" (e.g. start with a really high refcount)
* add a macro to look up a given string
* update each location that currently uses `_Py_IDENTIFIER()` to use the new 
macro instead

As part of this, we would also do the following:

* get rid of all C-API functions with `_Py_Identifer` parameters
* get rid of the old runtime state related to identifiers
* get rid of `_Py_Identifier`, `_Py_IDENTIFIER()`, etc.

(Note that there are several hundred uses of `_Py_IDENTIFIER()`, including a 
number of duplicates.)


Pros:

* reduces indirection (and extra calls) for C-API using the strings (making the 
code easier to understand and speeding it up)
* the objects are referenced from a fixed address in the static data section 
(speeding things up and allowing the C compiler to optimize better)
* there is no lazy allocation (or lookup, etc.) so there are fewer possible 
failures when the objects get used (thus less error return checking)
* simplifies the runtime state
* saves memory (at little, at least)
* the approach for per-interpreter is simpler (if needed)
* reduces the number of static variables in any given C module
* reduces the number of functions in the ("private") C-API
* "deep frozen" modules can use these strings
* other commonly-used strings could be pre-allocated by adding 
`_PyRuntimeState` fields for them

Cons:

* churn
* adding a string to the list requires modifying a separate file from the one 
where you actually want to use the string
* strings can get "orphaned" (we could prevent this with a check in `make 
check`)
* some PyPI packages may rely on `_Py_IDENTIFIER()` (even though it is 
"private" C-API)
* some strings may never get used for any given ./python invocation


Note that with a basic partial implementation (GH-30928) I'm seeing a 1% 
improvement in performance (see 
https://github.com/faster-cpython/ideas/issues/230).

--
assignee: eric.snow
components: Interpreter Core
messages: 411799
nosy: eric.snow, serhiy.storchaka, vstinner
priority: normal
pull_requests: 29107
severity: normal
stage: needs patch
status: open
title: Replace _Py_IDENTIFIER() with statically initialized objects.
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



[issue46506] [Windows] wrap CreateFile to support follow_symlinks

2022-01-26 Thread Eryk Sun


Eryk Sun  added the comment:

> switch to the newer CreateFile2() function

Apparently we need to allow FILE_SHARE_READ if CreateFile2() is used to 
implement os.stat(). It's not a big deal, but this is a design flaw.

CreateFile2() always uses the kernel I/O flag FILE_DISALLOW_EXCLUSIVE [1] when 
it calls NtCreateFile(). The intent of this flag is to avoid exclusive read 
access on the first open of a file when a user lacks write permission. Thus 
unprivileged users aren't allowed to prevent read access to critical system 
files. 

However, the implementation is flawed because it denies access even if the open 
doesn't request data access. It's also flawed because it allows exclusive read 
access when there are previous opens even if the previous opens have no data 
access.

Classically, IoCheckShareAccess() only checks for a sharing violation when an 
open requests read, write, or delete data access (i.e. FILE_READ_DATA, 
FILE_EXECUTE, FILE_WRITE_DATA, FILE_APPEND_DATA, DELETE). This is clearly 
explained in [MS-FSA] [2]. An open that only requests metadata access can never 
cause a sharing violation and poses no problem with regard to blocking access 
to a file.

---
[1] 
https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-iocreatefileex
[2] 
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-fsa/8c0e3f4f-0729-49f4-a14d-7f7add593819

--

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread Guido van Rossum


Guido van Rossum  added the comment:

Agree it's not the same issue, but there's similarity -- both are due to 
putting a stringized annotation (presumably a forward ref) somewhere inside 
another construct. whether it's list["N"] or Annotated["ClassVar[int]"].

--

___
Python tracker 

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



[issue38487] expat infinite loop

2022-01-26 Thread sping


sping  added the comment:

Hi StyXman,

I had a closer look at the files you shared, thanks for those, very helpful!

What I found is that expat_test.py uses a single scalar variable
(_DictSAXHandler.parser) to keep track of the related parser, while it would
need a stack to allow recursion.  In a way, the current approach is equivalent
to walking up the stack as expected but never going back down.
Once I make the code use a stack, the loop goes away.  I'm pasting the patch
inline (with two spaces indented globally) below.

During debugging, these are commands I used to compare internal libexpat 
behavior,
that may be of interest:

  EXPAT_ACCOUNTING_DEBUG=2 python expat_test.py |& sed 's,0x[0-9a-f]\+,XXX,' | 
tee pyexpat.txt

  EXPAT_ACCOUNTING_DEBUG=2 xmlwf -x test1.xml |& sed 's,0x[0-9a-f]\+,XXX,' | 
tee xmlwf.txt

  diff -u xmlwf.txt pyexpat.txt

Here's how I quick-fixed expat_test.py to make things work:

  # diff -u expat_test.py_ORIG expat_test.py
  --- expat_test.py_ORIG  2022-01-26 21:15:27.506458671 +0100
  +++ expat_test.py   2022-01-26 22:15:08.741384932 +0100
  @@ -7,11 +7,21 @@
   
   parser.ExternalEntityRefHandler = handler.externalEntityRef
   
  -# store the parser in the handler so we can recurse
  -handler.parser = parser
  -
   
   class _DictSAXHandler(object):
  +def __init__(self):
  +self._parsers = []
  +
  +def push_parser(self, parser):
  +self._parsers.append(parser)
  +
  +def pop_parser(self):
  +self._parsers.pop()
  +
  +@property
  +def parser(self):
  +return self._parsers[-1]
  +
   def externalEntityRef(self, context, base, sysId, pubId):
   print(context, base, sysId, pubId)
   external_parser = self.parser.ExternalEntityParserCreate(context)
  @@ -19,7 +29,9 @@
   setup_parser(external_parser, self)
   f = open(sysId, 'rb')
   print(f)
  +self.push_parser(external_parser)
   external_parser.ParseFile(f)
  +self.pop_parser()
   print(f)
   
   # all OK
  @@ -36,12 +48,13 @@
   namespace_separator
   )
   setup_parser(parser, handler)
  +handler.push_parser(parser)
   
   if hasattr(xml_input, 'read'):
   parser.ParseFile(xml_input)
   else:
   parser.Parse(xml_input, True)
  -return handler.item
  +# return handler.item  # there is no .item
   
   
   parse(open('test1.xml', 'rb'))
   
What do you tink?

PS: Please note that processing external entities has security implications
(see https://en.wikipedia.org/wiki/XML_external_entity_attack).

Best, Sebastian

--
nosy: +sping

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread Gregory Beauregard


Gregory Beauregard  added the comment:

I did try the proposed patch in bpo-41370 and verified it didn't resolve the 
issue so I'm not certain they strictly overlap, but I also haven't had time to 
fully digest the underlying issues in bpo-41370 yet.

I think it does have relevance for changes we want to make for dataclasses re: 
Annotated, though: https://bugs.python.org/issue46511

--

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread Guido van Rossum


Guido van Rossum  added the comment:

I wonder if this is at all similar to bpo-41370.

--

___
Python tracker 

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



[issue45173] Remove configparser deprecations

2022-01-26 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


--
pull_requests: +29106
pull_request: https://github.com/python/cpython/pull/30927

___
Python tracker 

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



[issue46540] dylibs not loading properly from NFS mounts

2022-01-26 Thread embassy_vfx


New submission from embassy_vfx :

MacOS Catalina 10.15.4 and 10.15.7
tested with XCode Python3.8 install and Python3.7.9 installer from 
https://www.python.org/ftp/python/3.7.9/python-3.7.9-macosx10.9.pkg (and my own 
build of 3.7.12)

When importing libraries that use shared object files to an NFS mounted 
directory, they do not open the dynamic library properly. We can use PySide2 as 
an example here. This workflow works fine in python 2.7 using the same steps.

Repro Steps:
1)pip install PySide2 to an NFS mounted directory: `/usr/local/bin/python3.7 -m 
pip install --target=//nfs_3.7 PySide2`
2)`export PYTHONPATH=//nfs_3.7`
3)run python `/usr/local/bin/python3.7`
4)import PySide2 - you should get an ImportError that looks like 
"dlopen(//nfs_3.7/shiboken2/shiboken2.abi3.so, 2): Library not 
loaded: @rpath/libshiboken2.abi3.5.15.dylib" - otool shows shiboken2.abi3.so 
has it's rpath set as @loader_path and I've confirmed both files exist.

If I follow the same procedure above but instead install PySide2 to 
`/tmp/local_3.7` everything works as expected and the binaries are loaded 
properly.

I had this same issue with standard library .so files when I installed my 
custom build of python to an NFS mounted directory (_ssl as an example) but 
only when running through a virtual environment. Possibly @rath/@loader_path 
related? This seems to only be an issue on MacOS as I have no issues on the 
same NFS mount on Linux.

--
components: macOS
messages: 411793
nosy: embassy_vfx, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: dylibs not loading properly from NFS mounts
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread Gregory Beauregard


Gregory Beauregard  added the comment:

typo: the line is `g: Annotated["ClassVar[int]", (2, 5)] = 3` in the code 
sample. Somehow I left it at only `(` for the annotation instead of `(2,5)`

--

___
Python tracker 

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



[issue46528] Simplify the VM's stack manipulations

2022-01-26 Thread Brandt Bucher


Brandt Bucher  added the comment:


New changeset 85483668647e7840c7b9a1877caaf2ef14a4443f by Brandt Bucher in 
branch 'main':
bpo-46528: Simplify the VM's stack manipulations (GH-30902)
https://github.com/python/cpython/commit/85483668647e7840c7b9a1877caaf2ef14a4443f


--

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread Gregory Beauregard


Change by Gregory Beauregard :


--
type:  -> behavior

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood, sobolevn

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread Gregory Beauregard


Change by Gregory Beauregard :


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

___
Python tracker 

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



[issue46539] typing: forward references don't understand special type forms

2022-01-26 Thread Gregory Beauregard


New submission from Gregory Beauregard :

Consider the following code on 3.11 main:

```
from typing import Annotated, ClassVar, get_type_hints

class DC:
a: ClassVar[int] = 3
b: ClassVar["int"] = 3
c: "ClassVar[int]" = 3
d: Annotated[ClassVar[int], (2, 5)] = 3
e: Annotated[ClassVar["int"], (2, 5)] = 3
f: "Annotated[ClassVar[int], (2, 5)]" = 3

class DC_Special_ForwardRef:
g: Annotated["ClassVar[int]", (] = 3

# OK
assert get_type_hints(DC, globals(), locals()) == {
"a": ClassVar[int],
"b": ClassVar[int],
"c": ClassVar[int],
"d": ClassVar[int],
"e": ClassVar[int],
"f": ClassVar[int],
}

# TypeError: typing.ClassVar[int] is not valid as type argument
get_type_hints(DC_Special_ForwardRef, globals(), locals())
```

Currently, the `Annotated["ClassVar[int]", (2, 5)]` annotation raises at 
runtime when `get_type_hints` is called, but all the other forward reference 
annotations are okay.

My understanding is this is because when typing._type_check runs on a type 
where special forms are allowed it's possible for the typing._type_convert it 
calls it itself run a typing._type_check on contained forward references. 
However, if that forward reference was itself a special form then it's possible 
to get an error because typing._type_check doesn't pass on that special forms 
are allowed.

I have drafted a patch to pass on this information. This will become important 
in the future as more special forms are allowed to wrap each other, such as 
allowing Final and ClassVar to nest each other in dataclasses, or when Required 
and NotRequired land. In the future we may also want to reconsider runtime 
restrictions on special forms in `typing.py` entirely and instead choose to 
leave this to type checkers.

Is my analysis/patch approach okay? Forward references can be tricky. Should we 
be discussing runtime restrictions in typing.py more generally in the future?

--
components: Library (Lib)
messages: 411790
nosy: GBeauregard, Jelle Zijlstra, gvanrossum, kj
priority: normal
severity: normal
status: open
title: typing: forward references don't understand special type forms
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue42982] Update suggested number of iterations for pbkdf2_hmac()

2022-01-26 Thread Zachary Ware


Zachary Ware  added the comment:

Rather than suggesting an actual number, perhaps we should link to an external 
resources that covers how to choose the number?

Or we leave it vague and say "The number of iterations should be chosen based 
on the hash algorithm and computing power; there is no universal 
recommendation, but hundreds of thousands of iterations may be reasonable."  
This avoids bikeshedding a specific number, but still gives a general idea of 
the magnitude of number involved.

--
nosy: +zach.ware

___
Python tracker 

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



[issue46487] `_SSLProtocolTransport` doesn't have the `get_write_buffer_limits` implementation.

2022-01-26 Thread Nova


Nova  added the comment:

Hey Andrew, thanks for the reply! 

> Would you prepare a pull request?

Sure.

> ... and documenting the change.

Apparently `WriteTransport.get_write_buffer_limits` is already documented 
(https://docs.python.org/3/library/asyncio-protocol.html#asyncio.WriteTransport.get_write_buffer_limits)
 

so please can you clarify on what did you mean by that? 

I am sorry this is my first time here.

--

___
Python tracker 

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



[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-26 Thread Mateusz Loskot


Mateusz Loskot  added the comment:

Not quite the answer I'd like to received, but thank you very much for the 
explanation.

I've submitted pull request removing the deprecated FAQ entry
https://github.com/python/cpython/pull/30925

--

___
Python tracker 

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



[issue46502] Py_CompileString no longer allows to tell "incomplete input" from "invalid input"

2022-01-26 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +29104
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30925

___
Python tracker 

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



[issue42926] Split compiler into code-gen, optimizer and assembler.

2022-01-26 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +iritkatriel

___
Python tracker 

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



[issue42926] Split compiler into code-gen, optimizer and assembler.

2022-01-26 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



[issue33205] GROWTH_RATE prevents dict shrinking

2022-01-26 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



[issue46534] Implementing PEP 673 (Self type)

2022-01-26 Thread Gobot1234


Change by Gobot1234 :


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

___
Python tracker 

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



[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

Can we close this issue? Or is there a remaining task?

--

___
Python tracker 

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



[issue43916] Mark static types newly converted to heap types as immutable: add Py_TPFLAGS_DISALLOW_INSTANTIATION type flag

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

In Python 3.11, 41 types are declared explicitly with the
Py_TPFLAGS_DISALLOW_INSTANTIATION flag:

* _curses_panel.panel
* _dbm.dbm
* _gdbm.gdbm
* _hashlib.HASH
* _hashlib.HASHXOF
* _hashlib.HMAC
* _md5.md5
* _multibytecodec.MultibyteCodec
* _sha1.sha1
* _sha256.sha224
* _sha256.sha256
* _sha512.sha384
* _sha512.sha512
* _sre.SRE_Scanner
* _ssl.Certificate
* _thread._localdummy
* _thread.lock
* _tkinter.Tcl_Obj
* _tkinter.tkapp
* _tkinter.tktimertoken
* _winapi.Overlapped
* _xxsubinterpreters.ChannelID
* array.arrayiterator
* curses.ncurses_version
* functools.KeyWrapper
* functools._lru_list_elem
* os.DirEntry
* os.ScandirIterator
* pyexpat.xmlparser
* re.Match
* re.Pattern
* select.devpoll
* select.poll
* sqlite3.Statement
* stderrprinter
* sys.flags
* sys.getwindowsversion
* sys.version_info
* unicodedata.UCD
* zlib.Compress
* zlib.Decompress

--

___
Python tracker 

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



[issue42926] Split compiler into code-gen, optimizer and assembler.

2022-01-26 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue46465] Regression caused by CALL_FUNCTION specialization for C function calls

2022-01-26 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



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

In Python 3.11, 68 heap types have the Py_TPFLAGS_IMMUTABLETYPE flag:

* _blake2.blake2b
* _blake2.blake2s
* _bz2.BZ2Compressor
* _bz2.BZ2Decompressor
* _csv.Dialect
* _csv.reader
* _csv.writer
* _dbm.dbm
* _gdbm.gdbm
* _hashlib.HASH
* _hashlib.HASHXOF
* _hashlib.HMAC
* _lsprof.Profiler
* _lzma.LZMACompressor
* _lzma.LZMADecompressor
* _md5.md5
* _multibytecodec.MultibyteCodec
* _multibytecodec.MultibyteIncrementalDecoder
* _multibytecodec.MultibyteIncrementalEncoder
* _multibytecodec.MultibyteStreamReader
* _multibytecodec.MultibyteStreamWriter
* _overlapped.Overlapped
* _queue.SimpleQueue
* _sha1.sha1
* _sha256.sha224
* _sha256.sha256
* _sha3.keccak_224
* _sha3.keccak_256
* _sha3.keccak_384
* _sha3.keccak_512
* _sha3.sha3_224
* _sha3.sha3_256
* _sha3.sha3_384
* _sha3.sha3_512
* _sha512.sha384
* _sha512.sha512
* _sre.SRE_Scanner
* _ssl.Certificate
* _ssl.MemoryBIO
* _ssl.SSLSession
* _ssl._SSLContext
* _ssl._SSLSocket
* ssl.SSLError
* _thread.RLock
* _thread._local
* _thread._localdummy
* _thread.lock
* _tokenize.TokenizerIter
* _winapi.Overlapped
* array.array
* array.arrayiterator
* functools.KeyWrapper
* functools._lru_cache_wrapper
* functools._lru_list_elem
* functools.partial
* mmap.mmap
* operator.attrgetter
* operator.itemgetter
* operator.methodcaller
* pyexpat.xmlparser
* re.Match
* re.Pattern
* sqlite3.Connection
* sqlite3.Cursor
* sqlite3.PrepareProtocol
* sqlite3.Row
* sqlite3.Statement
* unicodedata.UCD

--

___
Python tracker 

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



[issue34680] asyncio event_loop fails when accessed from multiple threads

2022-01-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Please feel free to propose pull request for documentation tuning.

--

___
Python tracker 

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



[issue43908] array.array should remain immutable: add Py_TPFLAGS_IMMUTABLETYPE flag

2022-01-26 Thread STINNER Victor


STINNER Victor  added the comment:

> Should the immutable flag also be applied to the heap types converted in and 
> before Python 3.9 before closing this issue?

I don't think that Python 3.9 should be changed. It's too late. IMO this issue 
is not important enough to introduce a new type flag in a minor Python 3.9.x 
bugfix release. I suggest to close this issue.

--

___
Python tracker 

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



[issue46520] `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words

2022-01-26 Thread Kodiologist


Kodiologist  added the comment:

And yes, while this behavior will look strange, the only code that will parse 
to AST nodes that require it will be code that uses exactly the same trick.

--

___
Python tracker 

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



[issue46520] `ast.unparse` produces syntactically illegal code for identifiers that look like reserved words

2022-01-26 Thread Kodiologist

Kodiologist  added the comment:

I've done very little work on CPython, but I do a lot of AST construction and 
call `ast.unparse` a lot in my work on Hylang, and I think this is a wart worth 
fixing. The real mistake was letting the user say `핕핖핗 = 1`, but that's been 
legal Python syntax for a long time, so I doubt a change to that would be 
welcome, especially one affecting old stable versions of Python like 3.9. 
Python has made its bed and now it must lie in it.

I think that with a pretty small amount of code (using code-point arithmetic 
instead of a dictionary with every ASCII letter), I can add Unicode "escaping" 
of reserved words to the part of `ast.unparse` that renders variable names. 
Would a patch of this kind be welcome?

--

___
Python tracker 

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



  1   2   >