[issue43509] CFunctionType object should be hashable in Python

2021-03-22 Thread Xinmeng Xia


Change by Xinmeng Xia :


--
type: compile error -> enhancement

___
Python tracker 

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



[issue43587] Long string arguments cause nis.map() segfault

2021-03-22 Thread Xinmeng Xia


New submission from Xinmeng Xia :

nis.maps() with long string argument will lead to segfault of interpreter.  See 
the following example:

=
Python 3.10.0a6 (default, Mar 19 2021, 11:45:56) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import nis;
>>> nis.maps('abs/'*1000)
Segmentation fault (core dumped)
=

System: ubuntu 16.04

--
components: Library (Lib)
messages: 389280
nosy: xxm
priority: normal
severity: normal
status: open
title: Long string arguments cause nis.map() segfault
type: crash
versions: Python 3.10

___
Python tracker 

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



[issue43587] Long string arguments cause nis.map() segfault

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

I can reproduce the crash. It's a not a bug in Python but in yp_master(). On my 
Fedora 33, this function comes from libnsl2 (/lib64/libnsl.so.2):

* https://bugz.fedoraproject.org/libnsl2
* https://github.com/thkukuk/libnsl

"""
This package contains the libnsl library. This library contains
the public client interface for NIS(YP) and NIS+.
This code was formerly part of glibc, but is now standalone to
be able to link against TI-RPC for IPv6 support.
"""

Please report the bug to https://bugz.fedoraproject.org/libnsl2 (or to you nis 
implementation).

--
nosy: +vstinner
resolution:  -> third party
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


New submission from junyixie :

use static module variable under building Python with 
--with-experimental-isolated-subinterpreters cause crash.
compiler_mod(struct compiler *c, mod_ty mod)
{
PyCodeObject *co;
int addNone = 1;
static PyObject *module;
if (!module) {
module = PyUnicode_InternFromString("");
if (!module)
return NULL;
}
...
}

--
components: Subinterpreters
messages: 389282
nosy: JunyiXie, vstinner
priority: normal
severity: normal
status: open
title: [Subinterpreters]: use static variable under building Python with 
--with-experimental-isolated-subinterpreters cause crash.
type: crash
versions: Python 3.10

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


Change by junyixie :


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

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


junyixie  added the comment:

43551 [Subinterpreters]: PyImport_Import use static silly_list under building 
Python with --with-experimental-isolated-subinterpreters share silly_list in 
multi subinterpreters  cause crash.
https://bugs.python.org/issue43551

--
message_count: 1.0 -> 2.0
pull_requests: +23722
pull_request: https://github.com/python/cpython/pull/24929

___
Python tracker 

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



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

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 56f031ec5281723b7c617edfa5748f2ae6a4c347 by Hai Shi in branch 
'master':
bpo-35134: Add include/cpython/compile.h (GH-24922)
https://github.com/python/cpython/commit/56f031ec5281723b7c617edfa5748f2ae6a4c347


--

___
Python tracker 

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



[issue23407] os.walk always follows Windows junctions

2021-03-22 Thread Eryk Sun


Eryk Sun  added the comment:

Python 3.8 introduced some behavior changes to how reparse points are 
supported, but generalized support for handling name-surrogate reparse points 
as symlinks was not implemented. Python continues to set S_IFLNK in st_mode 
only for IO_REPARSE_TAG_SYMLINK reparse points. This ensures that if 
os.path.islink() is true, the link can be read and copied exactly via 
os.readlink() and os.symlink(). Otherwise, islink() could be true but 
readlink() will fail or symlink() will be used to mistakenly copy a mountpoint 
as a symlink. 

A mountpoint is not equivalent to a symlink in a few cases. The major 
difference is that mountpoints are evaluated on the server side in a remote 
path, targeting devices on the server, whereas symlinks are evaluated on the 
client side, targeting devices on the client (e.g. its "C:" drive) and are 
subject to the client system's L2R (local to remote), L2L, R2L, and R2R symlink 
policy. Replacing a mountpoint with a symlink means that, at best, the path 
will no longer work when accessed remotely, and at worst the client will allow 
resolving the target locally to something that's dangerously wrong.

Another difference is how the kernel handles mounpoints when opening a path. 
The target of a mountpoint does not replace the previously traversed path 
components in the opened path, whereas the target path of a symlink does 
replace the opened path. The previously traversed path matters when the kernel 
resolves ".." components in the target of a relative symlink. For example, a 
relative symlink that traverses up the tree with ".." components may have been 
tested on a traversed directory, which worked fine. Then later the directory 
was replaced with a mountpoint (junction) for compatibility, which continued to 
work fine. But after a CopyTree() that naively replaces the mountpoint with a 
symlink, the copied relative symlink is either broken, or worse, it resolves to 
a target that's dangerously wrong.

A generalization of the readlink() and symlink() combination could be 
implemented to copy any type of name-surrogate reparse point. If Python had 
something like that, then it could reasonably support any name-surrogate 
reparse point as a "symlink". That's not without problems, considering the 
behavior isn't the same and APIs and other applications may only support 
IO_REPARSE_TAG_SYMLINK in various cases, but sometimes perfect is the enemy of 
good.

That said, os.walk() can still special case mountpoints and other 
name-surrogate reparse points. To support cases like this, the lstat() result 
was extended to include the st_reparse_tag value of name-surrogate reparse 
points. The stat module has the IO_REPARSE_TAG_SYMLINK and 
IO_REPARSE_TAG_MOUNT_POINT constants. A simple function that checks for a 
name-surrogate reparse point could be added as well -- i.e. bool(reparse_tag & 
0x2000).

---

Using st_reparse_tag to abstract checking the file type is awkward. I wanted to 
support a keyword-only parameter in Windows to expand the 'symlink' domain to 
include all name-surrogate reparse points. This parameter would have been added 
to os.[l]stat(), DirEntry.stat(), DirEntry.is_dir(), and DirEntry.is_file(), as 
well as os.path.islink() and DirEntry.is_symlink(). By default only 
IO_REPARSE_TAG_SYMLINK would have been handled as a symlink. But this idea 
wasn't accepted. Instead, custom checks have to be implemented whenever a 
problem needs the expanded 'symlink' domain.

--
versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue43569] test_importlib failed on installed Python

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

I confirm that aarch64 Fedora Stable Clang Installed 3.x is back to green, 
thanks for the fix.

--

___
Python tracker 

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



[issue42129] Support resources in namespace packages

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

> Please see bpo-43569: "test_importlib failed on installed Python" regression 
> introduced by commit 67148254146948041a77d8a2989f41b88cdb2f99.

It's now fixed, I close again this issue.

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

___
Python tracker 

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



[issue43589] Using defaultdict as kwarg to function reuses same dictionary every function call

2021-03-22 Thread Tenzin


New submission from Tenzin :

When using a `defaultdict` as a kwarg to a function that requires another 
argument, every call to the function uses the same dictionary instance instead 
of creating a new one.

```>>> from collections import defaultdict
>>> def meow(a, b=defaultdict(list)):
... b[a].append('moo')
... return b
... 
>>> c = meow('hi')
>>> c
defaultdict(, {'hi': ['moo']})
>>> c = meow('bye')
>>> c
defaultdict(, {'hi': ['moo'], 'bye': ['moo']})
>>> d = meow('hello')
>>> d
defaultdict(, {'hi': ['moo'], 'bye': ['moo'], 'hello': 
['moo']})```

Is this the correct behaviour? Occurred in 3.6.12, 3.7.9, 3.8.5, 3.8.6 and 
3.9.0.

--
messages: 389289
nosy: TenzinCHW
priority: normal
severity: normal
status: open
title: Using defaultdict as kwarg to function reuses same dictionary every 
function call
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue43447] Generate vectorcall code to parse arguments using Argument Clinic

2021-03-22 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue43551] [Subinterpreters]: PyImport_Import use static silly_list under building Python with --with-experimental-isolated-subinterpreters share silly_list in multi subinterpreters cause crash.

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 88d9983b561cd59e5f186d98227de0c1a022b498 by junyixie in branch 
'master':
bpo-43551: Fix PyImport_Import() for subinterpreters (GH-24929)
https://github.com/python/cpython/commit/88d9983b561cd59e5f186d98227de0c1a022b498


--

___
Python tracker 

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



[issue43551] [subinterpreters] Fix PyImport_Import() for subinterpreters

2021-03-22 Thread STINNER Victor


Change by STINNER Victor :


--
components: +Subinterpreters
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: [Subinterpreters]: PyImport_Import use static silly_list under building 
Python with --with-experimental-isolated-subinterpreters share silly_list in 
multi subinterpreters  cause crash. -> [subinterpreters] Fix PyImport_Import() 
for subinterpreters
versions: +Python 3.10

___
Python tracker 

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



[issue43589] Using defaultdict as kwarg to function reuses same dictionary every function call

2021-03-22 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This is normal, expected behaviour and has nothing to do with defaultdicts 
specifically. Any mutable object would behave the same way.

Function default parameters are evaluated only once, when the function is 
defined. They are not re-evaluated on each call.

The standard pattern used for re-evaluating the default is:

def function(arg=None):
if arg is None:
arg = defaultdict(list)
...

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie

junyixie  added the comment:

grep -E 'static (\w+) \*(\w+) =' $(find . -name "*.c") | wc -l
67 static variable may need fix
➜  cpython git:(master) grep -E 'static (\w+) \*(\w+) =' $(find . -name "*.c")
./PC/winreg.c:static char *failMsg = "bad operand type";
./Python/codecs.c:static _PyUnicode_Name_CAPI *ucnhash_capi = NULL;
./Python/initconfig.c:static char *_Py_StandardStreamEncoding = NULL;
./Python/initconfig.c:static char *_Py_StandardStreamErrors = NULL;
./Python/import.c:static PyObject *extensions = NULL;
./Python/import.c:static PyObject *builtins_str = NULL;
./Python/import.c:static PyObject *import_str = NULL;
./Python/sysmodule.c:static PyObject *newline = NULL;
./Python/_warnings.c:static PyObject *importlib_string = NULL;
./Python/_warnings.c:static PyObject *bootstrap_string = NULL;
./Objects/unicodeobject.c:static _PyUnicode_Name_CAPI *ucnhash_capi = NULL;
./Objects/codeobject.c:static PyObject *emptystring = NULL;
./Objects/codeobject.c:static PyObject *nulltuple = NULL;
./Objects/listobject.c:static PyObject *indexerr = NULL;
./Objects/exceptions.c:static PyObject *print_prefix = NULL;
./Objects/exceptions.c:static PyObject *exec_prefix = NULL;
./Objects/boolobject.c:static PyObject *false_str = NULL;
./Objects/boolobject.c:static PyObject *true_str = NULL;
./Parser/pegen.c:static void *cache = NULL;
./Modules/_cursesmodule.c:static char *screen_encoding = NULL;
./Modules/arraymodule.c:static PyObject *array_reconstructor = NULL;
./Modules/_tkinter.c:static PyObject *tcl_library_path = NULL;
./Modules/_tkinter.c:static PyThreadState *tcl_tstate = NULL;
./Modules/_tkinter.c:static PyThreadState *event_tstate = NULL;
./Modules/syslogmodule.c:static PyObject *S_ident_o = NULL; 
 /*  identifier, held by openlog()  */
./Modules/_tracemalloc.c:static PyObject *unknown_filename = NULL;
./Modules/_tracemalloc.c:static _Py_hashtable_t *tracemalloc_filenames = NULL;
./Modules/_tracemalloc.c:static traceback_t *tracemalloc_traceback = NULL;
./Modules/_tracemalloc.c:static _Py_hashtable_t *tracemalloc_tracebacks = NULL;
./Modules/_tracemalloc.c:static _Py_hashtable_t *tracemalloc_traces = NULL;
./Modules/_tracemalloc.c:static _Py_hashtable_t *tracemalloc_domains = NULL;
./Modules/_ssl.c:static PyObject *x509_asn = NULL;
./Modules/_ssl.c:static PyObject *pkcs_7_asn = NULL;
./Modules/_ssl.c:static PyThread_type_lock *_ssl_locks = NULL;
./Modules/_testbuffer.c:static PyObject *structmodule = NULL;
./Modules/_testbuffer.c:static PyObject *Struct = NULL;
./Modules/_testbuffer.c:static PyObject *calcsize = NULL;
./Modules/_testbuffer.c:static PyObject *simple_format = NULL;
./Modules/_testbuffer.c:static char *infobuf = NULL;
./Modules/_io/bufferedio.c:static PyObject *eintr_int = NULL;
./Modules/_asynciomodule.c:static futureiterobject *fi_freelist = NULL;
./Modules/_zoneinfo.c:static PyObject *io_open = NULL;
./Modules/_zoneinfo.c:static PyObject *_tzpath_find_tzfile = NULL;
./Modules/_zoneinfo.c:static PyObject *_common_mod = NULL;
./Modules/_zoneinfo.c:static PyObject *TIMEDELTA_CACHE = NULL;
./Modules/_zoneinfo.c:static PyObject *ZONEINFO_WEAK_CACHE = NULL;
./Modules/_zoneinfo.c:static StrongCacheNode *ZONEINFO_STRONG_CACHE = NULL;
./Modules/_sqlite/microprotocols.c:static PyObject *psyco_adapters = NULL;
./Modules/_ssl/debughelpers.c:static PyThread_type_lock *lock = NULL;
./Modules/_datetimemodule.c:static PyObject *us_per_ms = NULL;  /* 1000 */
./Modules/_datetimemodule.c:static PyObject *us_per_second = NULL;  /* 100 
*/
./Modules/_datetimemodule.c:static PyObject *us_per_minute = NULL;  /* 1e6 * 60 
as Python int */
./Modules/_datetimemodule.c:static PyObject *us_per_hour = NULL;/* 1e6 * 
3600 as Python int */
./Modules/_datetimemodule.c:static PyObject *us_per_day = NULL; /* 1e6 * 
3600 * 24 as Python int */
./Modules/_datetimemodule.c:static PyObject *us_per_week = NULL;/* 
1e6*3600*24*7 as Python int */
./Modules/_datetimemodule.c:static PyObject *seconds_per_day = NULL; /* 3600*24 
as Python int */
./Modules/_datetimemodule.c:static PyObject *module = NULL;
./Modules/_decimal/_decimal.c:static PyObject *tls_context_key = NULL;
./Modules/_decimal/_decimal.c:static PyDecContextObject *cached_context = NULL;
./Modules/_decimal/_decimal.c:static PyObject *current_context_var = NULL;
./Modules/_decimal/_decimal.c:static PyObject *default_context_template = NULL;
./Modules/_decimal/_decimal.c:static PyObject *basic_context_template = NULL;
./Modules/_decimal/_decimal.c:static PyObject *extended_context_template = NULL;
./Modules/_decimal/_decimal.c:static PyObject *DecimalException = NULL;
./Modules/_decimal/_decimal.c:static PyObject *Rational = NULL;
./Modules/_decimal/_decimal.c:static PyTypeObject *DecimalTuple = NULL;
./Modules/_decimal/_decimal.c:static PyObject *capsule = NULL;

--

___
Python tracker 


[issue43575] map() instantiation time reducing by using PEP 590 vectorcall

2021-03-22 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 86883d40e93acae980e52b90fddd7d042e439beb by Dong-hee Na in branch 
'master':
bpo-43575: Use PEP 590 vectorcall to speed up map() (GH-24955)
https://github.com/python/cpython/commit/86883d40e93acae980e52b90fddd7d042e439beb


--

___
Python tracker 

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



[issue43575] map() instantiation time reducing by using PEP 590 vectorcall

2021-03-22 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

Mark Dickinson: "I just noticed the change to dtoa.c in GH-24821. Please could 
you explain what the benefit of this change was?"

The rationale is explained in bpo-40512. The goal is to run multiple Python 
interpreters in parallel in the same process.

dtoa.c had global variables shared by all interpreters without locking, so two 
intepreters could corrupt the freelist consistency.


Mark Dickinson: "In general, we need to be very conservative with changes to 
dtoa.c: it's a complex, fragile, performance-critical piece of code, and 
ideally we'd like it not to diverge from the upstream code any more than it 
already has, in case we need to integrate bugfixes from upstream."

I know that dtoa.c was copied from a third party project. But the commit 
5bd1059184b154d339f1bd53d23c98b5bcf14c8c change change only makes sense in 
Python, I don't think that it would make sense to propose it upstream.

dtoa.c _Py_dg_strtod() is called by:

* float.__round__()
* _PyOS_ascii_strtod()

_PyOS_ascii_strtod() is called PyOS_string_to_double() which is called by:

* float_from_string_inner()
* complex_from_string_inner()
* pickle load_float()
* parser parsenumber_raw()
* marshal r_float_str

dtoa.c _Py_dg_dtoa() is called by:

* float.__round__()
* PyOS_double_to_string()

PyOS_double_to_string() is called by:

* float_repr()
* complex_repr()
* bytes % float: _PyBytes_FormatEx()
* str % float: PyUnicode_Format()
* _PyLong_FormatAdvancedWriter()
* _PyComplex_FormatAdvancedWriter()
* pickle save_float()
* marshal w_float_str


I guess that the most important use case are float(str) and str(float). I wrote 
attached bench_dtoa.py to measure the effect on performance of the commit 
5bd1059184b154d339f1bd53d23c98b5bcf14c8c:
---
$ python3 -m pyperf compare_to before.json after.json 
float('0'): Mean +- std dev: [before] 80.5 ns +- 3.1 ns -> [after] 90.1 ns +- 
3.6 ns: 1.12x slower
float('1.0'): Mean +- std dev: [before] 89.5 ns +- 4.3 ns -> [after] 97.2 ns +- 
2.6 ns: 1.09x slower
float('340282366920938463463374607431768211455'): Mean +- std dev: [before] 480 
ns +- 42 ns -> [after] 514 ns +- 13 ns: 1.07x slower
float('104431413152506691752710716624382579964249047383780384233483283953907971557456848826811934997558340890106714439262837987573438185793607263236087851365277945956976543709998340361590134383718314428070011855946226376318839397712745672334684344586617496807908705803704071284048740118609114467977783598029006686938976881787785946905630190260940599579453432823469303026696443059025015972399867714215541693835559885291486318237914434496734087811872639496475100189041349008417061675093668333850551032972088269550769983616369411933015213796825837188091833656751221318492846368125550225998300412344784862595674492194617023806505913245610825731835380087608622102834270197698202313169017678006675195485079921636419370285375124784014907159135459982790513399611551794271106831134090584272884279791554849782954323534517065223269061394905987693002122963395687782878948440616007412945674919823050571642377154816321380631045902916136926708342856440730447899971901781465763473223850267253059899795996090799
 
469201774624817718449867455659250178329070473119433165550807568221846571746373296884912819520317457002440926616910874148385078411929804522981857338977648103126085903001302413467189726673216491511131602920781738033436090243804708340403154190335'):
 Mean +- std dev: [before] 717 ns +- 36 ns -> [after] 990 ns +- 27 ns: 1.38x 
slower
str(0.0): Mean +- std dev: [before] 113 ns +- 8 ns -> [after] 106 ns +- 4 ns: 
1.06x faster
str(1.0): Mean +- std dev: [before] 141 ns +- 11 ns -> [after] 135 ns +- 17 ns: 
1.05x faster
str(inf): Mean +- std dev: [before] 110 ns +- 11 ns -> [after] 98.9 ns +- 3.3 
ns: 1.12x faster

Benchmark hidden because not significant (1): str(3.402823669209385e+38)

Geometric mean: 1.05x slower
---

I built Python with "./configure --enable-optimizations --with-lto" on Fedora 
33 (GCC 10.2.1). I didn't use CPU isolation.

Oh, float(str) is between 1.09x slower and 1.38x slower.

On the other side, str(float) is between 1.06x and 1.12x faster, I'm not sure 
why. I guess that the problem is that PGO+LTO build is not reproducible, GCC 
might prefer to optimize some functions or others depending on the PROFILE_TASK 
(Makefile.pre.in, command used by GCC profiler).


Mark Dickinson: "It's feeling as though the normal Python development process 
is being bypassed here. As I understand it, this and similar changes are in aid 
of per-subinterpreter GILs. Has there been agreement from the core devs or 
steering council that this is a desirable goal? Should there be a PEP before 
more changes like this are made? (Or maybe there's already a PEP, that I 
missed? I know about PEP 554, but that PEP is explicit that GIL sharing is out 
of scope.)"


Honestly, I didn't expect any significant impact on performance on the change. 
So I merged the PR as I merge other fixes for subinterpreters. It seems li

[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-03-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23723
pull_request: https://github.com/python/cpython/pull/24964

___
Python tracker 

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



[issue43010] @functools.wraps and abc.abstractmethod interoperability

2021-03-22 Thread Erez Zinman


Erez Zinman  added the comment:

Sorry for the late response. I forgot about that.

I believe one of us misunderstands the problem. The problem is that 
`functools.wraps` copies the `__isabstractmethod__` in the first place. 

Consider the following example:

```

class ModuleTemplate(ABC):

@abstractmethod
def _internal_main_operation(self, a: int, b: str, c: list) -> bool:
pass

@functools.wraps(_internal_main_operation)
def external_main_operation(self, *args, **kwargs):
print('LOG: Operation started.')
try:
ret = self._internal_main_operation(*args, **kwargs)
except:
print('LOG: Operation finished successfully.')
raise
else:
print('LOG: Operation finished successfully.')

return ret


class ModulePositiveCheck(ModuleTemplate):
def _internal_main_operation(self, a: int, b: str, c: list) -> bool:
return a > 0

```

In that case, I have a class that has a main operation that can be called 
either from the outside or internally. The outside call may be wrapped with 
some aspect-specific functionality like thread-safety, logging, exception 
handling, etc.; and the internal call implements the core logic of the class. 
In that (pretty common) pattern, I wouldn't want the `wraps` function to copy 
all the `abc` attributes because they're irrelevant. In fact, I'm having 
trouble thinking of a case where you WOULD like these attributes to be copied.


The solution here, I think, is to exclude these attributes from being copied 
within `functools.update_wrapper`. If you do want to allow copying these 
attributes (I don't see why, but anyway), you could add an `excluded` parameter 
to `update_wrapper`.

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


Change by junyixie :


--
pull_requests: +23724
pull_request: https://github.com/python/cpython/pull/24965

___
Python tracker 

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



[issue43590] Collapse sidebar issue on https://docs.python.org/3/

2021-03-22 Thread Lucijan Drnasin


New submission from Lucijan Drnasin :

Sidebar bug on python welcoming page for version 3.9.2. Two-arrow  span on 
sidebar (span that has fixed position) is going off the sidebar if I scroll all 
the way down and then I inspect the page. After inspecting (opening dev tools) 
it appears there is a litle bit more room to scrool down and span(litle two 
arrows) goes off the page.

--
messages: 389296
nosy: lucijan345
priority: normal
severity: normal
status: open
title: Collapse sidebar issue on https://docs.python.org/3/
type: behavior

___
Python tracker 

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



[issue43591] Parser aborts on incomplete/incorrect unicode literals in interactive mode

2021-03-22 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Incomplete unicode literals abort iso. generating SyntaxError:

(lldb) target create "./python.exe"
Current executable set to '/Users/erlendaasland/src/cpython.git/python.exe' 
(x86_64).
(lldb) r
Process 98955 launched: '/Users/erlendaasland/src/cpython.git/python.exe' 
(x86_64)
Python 3.10.0a6+ (heads/main:9a50ef43e4, Mar 22 2021, 11:18:33) [Clang 12.0.0 
(clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "\u1f"
Assertion failed: (col_offset >= 0 && (unsigned long)col_offset <= 
strlen(str)), function byte_offset_to_character_offset, file Parser/pegen.c, 
line 150.
Process 98955 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = hit program assert
frame #4: 0x00019bd6 
python.exe`byte_offset_to_character_offset(line=0x0001013f1220, 
col_offset=7) at pegen.c:150:5
   147  if (!str) {
   148  return 0;
   149  }
-> 150  assert(col_offset >= 0 && (unsigned long)col_offset <= strlen(str));
   151  PyObject *text = PyUnicode_DecodeUTF8(str, col_offset, "replace");
   152  if (!text) {
   153  return 0;
Target 0: (python.exe) stopped.
(lldb) p col_offset
(Py_ssize_t) $0 = 7
(lldb) p str
(const char *) $1 = 0x0001013f1250 "\"\\u1f\""
(lldb) p (size_t) strlen(str)
(size_t) $2 = 6



Python 3.9 behaviour:
Python 3.9.2 (v3.9.2:1a79785e3e, Feb 19 2021, 09:06:10) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "\u1f"
  File "", line 1
"\u1f"
  ^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in 
position 0-3: truncated \u escape



Git bisect says the regression was introduced by this commit:

commit 08fb8ac99ab03d767aa0f1cfab3573eddf9df018
Author: Pablo Galindo 
Date:   Thu Mar 18 01:03:11 2021 +

bpo-42128: Add 'missing :' syntax error message to match statements 
(GH-24733)


I made a workaround (see attached patch), but I guess that's far from the 
correct solution :)

--
components: Unicode
files: patch.diff
keywords: patch
messages: 389297
nosy: erlendaasland, ezio.melotti, lys.nikolaou, pablogsal, vstinner
priority: normal
severity: normal
status: open
title: Parser aborts on incomplete/incorrect unicode literals in interactive 
mode
type: crash
versions: Python 3.10
Added file: https://bugs.python.org/file49900/patch.diff

___
Python tracker 

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



[issue43591] Parser aborts on incomplete/incorrect unicode literals in interactive mode

2021-03-22 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Correction, git bisect pointed to _this_ commit (not 
08fb8ac99ab03d767aa0f1cfab3573eddf9df018):

commit cd8dcbc851fcc312722cdb5544c2f25cf46b3f8a
Author: Pablo Galindo 
Date:   Sun Mar 14 04:38:40 2021 +0100

bpo-43410: Fix crash in the parser when producing syntax errors when 
reading from stdin (GH-24763)

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


junyixie  added the comment:

fix
./Objects/exceptions.c:static PyObject *print_prefix = NULL;
./Objects/exceptions.c:static PyObject *exec_prefix = NULL;

https://github.com/python/cpython/pull/24965

--

___
Python tracker 

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



[issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe()

2021-03-22 Thread STINNER Victor


New submission from STINNER Victor :

x86-64 macOS 3.x:
https://buildbot.python.org/all/#/builders/366/builds/969

Build triggered by the commit 88d9983b561cd59e5f186d98227de0c1a022b498 which 
changes PyImport_Import().


The buildbot is running on macOS 10.15.7 (Darwin Kernel Version 19.6.0) with a 
limit of 256 file descriptors.


The latest successful build is build 968, whereas the the RLIMIT_NOFILE 
resource soft limit was also set to 256:
https://buildbot.python.org/all/#/builders/366/builds/968


test.pythoninfo:

* os.uname: posix.uname_result(sysname='Darwin', nodename='mattb-mbp2', 
release='19.6.0', version='Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 
PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64', machine='x86_64')
* sysconfig[HOST_GNU_TYPE]: x86_64-apple-darwin19.6.0
* platform.platform: macOS-10.15.7-x86_64-i386-64bit
* resource.RLIMIT_NOFILE: (256, 9223372036854775807)


FAIL: test_multiprocessing_pool_circular_import 
(test.test_importlib.test_threaded_import.ThreadedImportTests)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_importlib/test_threaded_import.py",
 line 258, in test_multiprocessing_pool_circular_import
script_helper.assert_python_ok(fn)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/support/script_helper.py",
 line 160, in assert_python_ok
return _assert_python(True, *args, **env_vars)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/support/script_helper.py",
 line 145, in _assert_python
res.fail(cmd_line)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/support/script_helper.py",
 line 72, in fail
raise AssertionError("Process return code is %d\n"
AssertionError: Process return code is 1
command line: 
['/Users/buildbot/buildarea/3.x.billenstein-macos/build/python.exe', '-X', 
'faulthandler', '-I', 
'/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_importlib/partial/pool_in_threads.py']

stdout:
---

---

stderr:
---
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/test/test_importlib/partial/pool_in_threads.py",
 line 9, in t
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/context.py",
 line 119, in Pool
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/pool.py",
 line 196, in __init__
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/context.py",
 line 113, in SimpleQueue
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/queues.py",
 line 341, in __init__
self._reader, self._writer = connection.Pipe(duplex=False)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/connection.py",
 line 532, in Pipe
fd1, fd2 = os.pipe()
OSError: [Errno 24] Too many open files
/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:224:
 UserWarning: resource_tracker: There appear to be 110 leaked semaphore objects 
to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '
/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:237:
 UserWarning: resource_tracker: '/mp-56i6i4ap': [Errno 2] No such file or 
directory
  warnings.warn('resource_tracker: %r: %s' % (name, e))
/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:237:
 UserWarning: resource_tracker: '/mp-0au5otkl': [Errno 2] No such file or 
directory
  warnings.warn('resource_tracker: %r: %s' % (name, e))
/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:237:
 UserWarning: resource_tracker: '/mp-vcv0xwbi': [Errno 2] No such file or 
directory
  warnings.warn('resource_tracker: %r: %s' % (name, e))
/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:237:
 UserWarning: resource_tracker: '/mp-vxfb4ks9': [Errno 2] No such file or 
directory
  warnings.warn('resource_tracker: %r: %s' % (name, e))
/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:237:
 UserWarning: resource_tracker: '/mp-5e2_0z1f': [Errno 2] No such file or 
directory
  warnings.warn('resource_tracker: %r: %s' % (name, e))
/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:237:
 UserWarning: resource_tracker: '/mp-6vsgax4k': [Errno 2] No such file or 
directory
  warnings.warn('resource_tracker: %r: %s' % (name, e))
/Users/buildbot/buildarea/3.x.billenstein-macos/build/Lib/multiprocessing/resource_tracker.py:237:
 UserWarning: resource_tracker: '/mp-mq51g4b_': [Errno 2] No such file or 
directory
  warnings.warn('resource_tracker: %r: %s' % (name, e))
/Users/buildbot/buildarea/3.x.billenstei

[issue43551] [subinterpreters] Fix PyImport_Import() for subinterpreters

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

See bpo-43592: test_importlib: test_multiprocessing_pool_circular_import() 
fails with "Too many open files" error on os.pipe().

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


Change by junyixie :


--
pull_requests: +23726
pull_request: https://github.com/python/cpython/pull/24966

___
Python tracker 

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



[issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe()

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

test_importlib only fails *randomly* on x86-64 macOS 3.x.

For example, the build 970 is a success (but orange): "Tests result: FAILURE 
then SUCCESS". test_importlib failed with too many open files, and then passed.

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

Oh. I didn't expect so many "static" variables. I suggest to wait until a PEP 
is accepted for running multiple interpreters in parallel.

--

___
Python tracker 

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



[issue43591] Parser aborts on incomplete/incorrect unicode literals in interactive mode

2021-03-22 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue40521] [subinterpreters] Make free lists and unicode caches per-interpreter

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 39f643614d03748a5fad462fe7ed26a174a522fa by Victor Stinner in 
branch 'master':
Revert "bpo-40521: Make dtoa bigint free list per-interpreter (GH-24821)" 
(GH-24964)
https://github.com/python/cpython/commit/39f643614d03748a5fad462fe7ed26a174a522fa


--

___
Python tracker 

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



[issue43010] @functools.wraps and abc.abstractmethod interoperability

2021-03-22 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Did you try adding updated=()?

@functools.wraps(_internal_main_operation, updated=())
def external_main_operation(self, *args, **kwargs):

--

___
Python tracker 

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



[issue43010] @functools.wraps and abc.abstractmethod interoperability

2021-03-22 Thread Erez Zinman


Erez Zinman  added the comment:

I haven't because I don't need it anymore and it will surely work. Yet by doing 
so, other attributes will not be copied. I think that the `abc`-related 
attributes are irrelevant regardless, and should be omitted (at least by 
default).

--

___
Python tracker 

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



[issue43010] @functools.wraps and abc.abstractmethod interoperability

2021-03-22 Thread Erez Zinman


Erez Zinman  added the comment:

This is an interoperability bug. Maybe not a severe one (due to the 
workaround), but it's still a bug.

--

___
Python tracker 

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



[issue43520] Make Fraction(string) handle non-ascii slashes

2021-03-22 Thread Carl Anderson


Carl Anderson  added the comment:

>Carl: can you say more about the problem that motivated this issue?

@mark.dickinson

I was parsing a large corpus of ingredients strings from web-scraped recipes. 
My code to interpret strings such as "1/2 cup sugar" would fall over every so 
often due to this issue as they used fraction slash and other visually similar 
characters

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


Change by junyixie :


--
pull_requests: +23727
pull_request: https://github.com/python/cpython/pull/24968

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


junyixie  added the comment:

-> Okay, I will fix these problems first. (Need for my own project)

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


junyixie  added the comment:

Okay, I will fix these problems first. (Need for your own project)

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


Change by junyixie :


--
pull_requests: +23728
pull_request: https://github.com/python/cpython/pull/24969

___
Python tracker 

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



[issue43593] pymalloc is not aware of Memory Tagging Extension (MTE) and crashes

2021-03-22 Thread ggardet


New submission from ggardet :

When Memory Tagging Extension (MTE) [0] is enabled on aarch64, python malloc 
make programs to crash. 
I noticed it while trying to use GDB with MTE enabled in user-space [1], and 
gdb crashed on start-up. Rebuilding python (3.8) using '--without-pymalloc' 
option allows to workaround the problem. 
For glibc, you need version 2.33 or later and build glibc with 
'--enable-memory-tagging' option. I guess that patches similar to glibc's 
patches are required for pymalloc.

[0]: 
https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/enhancing-memory-safety
[1]: https://en.opensuse.org/ARM_architecture_support#User-space_support

--
components: Library (Lib)
messages: 389312
nosy: ggardet
priority: normal
severity: normal
status: open
title: pymalloc is not aware of Memory Tagging Extension (MTE) and crashes
versions: Python 3.8

___
Python tracker 

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



[issue43593] pymalloc is not aware of Memory Tagging Extension (MTE) and crashes

2021-03-22 Thread ggardet


ggardet  added the comment:

Is there any runtime option (env variable or something else) to use glibc 
malloc instead of pymalloc? Or the choice made at compile time is immutable?

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


Change by junyixie :


--
pull_requests: +23729
pull_request: https://github.com/python/cpython/pull/24970

___
Python tracker 

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



[issue43594] A metaclass that inherits both `ABC` and `ABCMeta` breaks on `__subclasscheck__`

2021-03-22 Thread Erez Zinman


New submission from Erez Zinman :

Consider the following example:

```
from abc import ABCMeta, ABC

class MetaclassMixin(ABC):
pass 

class Meta(MetaclassMixin, ABCMeta):
pass

class A(metaclass=Meta):
pass

```

Then the call `isinstance(A, Meta)` returns `True` but `isinstance(1, Meta)` 
raises 

 >>> TypeError: __subclasscheck__() missing 1 required positional argument: 
 >>> 'subclass'

Checked on 3.6.9, 3.8.0 & 3.8.8

--
components: Library (Lib)
messages: 389314
nosy: erezinman
priority: normal
severity: normal
status: open
title: A metaclass that inherits both `ABC`  and `ABCMeta` breaks on 
`__subclasscheck__`
versions: Python 3.6, Python 3.8

___
Python tracker 

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



[issue43593] pymalloc is not aware of Memory Tagging Extension (MTE) and crashes

2021-03-22 Thread Christian Heimes


Christian Heimes  added the comment:

pymalloc is a compile-time option. The configure flag sets or unsets 
WITH_PYMALLOC. The define is then used by 
https://github.com/python/cpython/blob/master/Objects/obmalloc.c to change the 
internal allocator.

The flag may also affect the ABI of Python and affect binary wheels. It might 
break compatibility with manylinux wheels for aarch64.

Victor, please take a look.

--
nosy: +christian.heimes, vstinner

___
Python tracker 

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



[issue43538] [Windows] support args and cwd in os.startfile()

2021-03-22 Thread Jeremy Kloth


Change by Jeremy Kloth :


--
nosy: +jkloth

___
Python tracker 

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



[issue43593] pymalloc is not aware of Memory Tagging Extension (MTE) and crashes

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

> When Memory Tagging Extension (MTE) [0] is enabled on aarch64, python malloc 
> make programs to crash. 

Would you mind to elaborate what does crash exactly?

Can you please test if https://github.com/python/cpython/pull/14474 fix your 
issue?

--

___
Python tracker 

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



[issue43595] Can not add a metclass that inherits both ABCMeta & ABC to a Union

2021-03-22 Thread Erez Zinman


New submission from Erez Zinman :

Related to Issue #43594.

When running the following code

```
from abc import ABCMeta, ABC
from typing import Union

class MetaclassMixin(ABC):
pass 

class Meta(MetaclassMixin, ABCMeta):
pass

print(Union[str, Meta])
```

An exception is raised

 >>> TypeError: descriptor '__subclasses__' of 'type' object needs an argument


Tested on v3.6.9

--
messages: 389317
nosy: erezinman
priority: normal
severity: normal
status: open
title: Can not add a metclass that inherits both ABCMeta & ABC to a Union
versions: Python 3.6

___
Python tracker 

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



[issue43593] pymalloc is not aware of Memory Tagging Extension (MTE) and crashes

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

A workaround is to disable pymalloc at runtime using PYTHONMALLOC=malloc 
environment variable. But it makes Python 10-20% slower.

--

___
Python tracker 

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



[issue43558] The dataclasses documentation should mention how to call super().__init__

2021-03-22 Thread junyixie


Change by junyixie :


--
keywords: +patch
nosy: +JunyiXie
nosy_count: 1.0 -> 2.0
pull_requests: +23730
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/24971

___
Python tracker 

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



[issue42914] pprint numbers with underscore

2021-03-22 Thread Stéphane Blondon

Stéphane Blondon  added the comment:

I changed the default to be backward compatible (so underscore_numbers=False).

I think it would be better with underscore_numbers enabled by default but I 
understand the need for stability. Perhaps such break could be done in the 
future (in version 3.12 or v.4)?

--

___
Python tracker 

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



[issue43595] Can not add a metclass that inherits both ABCMeta & ABC to a Union

2021-03-22 Thread Erez Zinman


Erez Zinman  added the comment:

This is actually a lot worse and unrelated to the aforementioned issue.

The code 

```
from typing import Union
from abc import ABC


Union[str, ABC]
```

raises the exception

 >>> TypeError: descriptor '__subclasses__' of 'type' object needs an argument

--

___
Python tracker 

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



[issue38905] venv python reports wrong sys.executable in a subprocess on Windows

2021-03-22 Thread Assaf


Assaf  added the comment:

The fact that now there is a redirector process seems to me like a regression 
issue.
I have an application which Popen several processes and uses the Popen object 
in order to get the subprocesses pids and act upon this pids (i.e. looks for 
log files with associated pid).

Now this breaks because the subprocess pid is the one of the redirector and not 
the actual one.

This is similar to 'Ray' issue mentioned earlier.

--
nosy: +awaizman

___
Python tracker 

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



[issue43558] The dataclasses documentation should mention how to call super().__init__

2021-03-22 Thread junyixie


Change by junyixie :


--
pull_requests: +23731
pull_request: https://github.com/python/cpython/pull/24972

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


junyixie  added the comment:

I will fix the static variable problem of frequently used code

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread Dong-hee Na


Dong-hee Na  added the comment:

@JunyiXie

Please wait your patch until the PEP is approved.

--
nosy: +corona10

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

Until the PEP is accepted, you can start working on a branch if you want. You 
can post the link to your branch.

--

___
Python tracker 

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



[issue43590] Collapse sidebar issue on https://docs.python.org/3/

2021-03-22 Thread Ned Deily


Change by Ned Deily :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
type: behavior -> 

___
Python tracker 

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



[issue43591] Parser aborts on incomplete/incorrect unicode literals in interactive mode

2021-03-22 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue43591] Parser aborts on incomplete/incorrect unicode literals in interactive mode

2021-03-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks for the report and the patch Erlend!. I have transformed it into a PR 
with attribution in PR 24973

--

___
Python tracker 

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



[issue43573] [types] Document __spec__ for types.ModuleType

2021-03-22 Thread Brett Cannon


Change by Brett Cannon :


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

___
Python tracker 

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



[issue43573] [types] Document __spec__ for types.ModuleType

2021-03-22 Thread Brett Cannon


Change by Brett Cannon :


--
assignee: docs@python -> brett.cannon
stage: patch review -> 

___
Python tracker 

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



[issue42137] Prefer using __spec__ over module_repr() for ModuleType.__repr__

2021-03-22 Thread Brett Cannon


Brett Cannon  added the comment:

Meant to say, "existence of the _method_ isn't problematic".

--

___
Python tracker 

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



[issue24147] Dialect class defaults are not documented.

2021-03-22 Thread Irit Katriel


Irit Katriel  added the comment:

Brandon's patch has not been applied, it needs to be converted into a git PR.

--
keywords: +easy -patch
nosy: +iritkatriel
versions: +Python 3.10 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue12762] OSError msg should display symbolic error codes

2021-03-22 Thread Irit Katriel


Change by Irit Katriel :


--
title: EnvironmentError_str contributes to unportable code -> OSError msg 
should display symbolic error codes
versions: +Python 3.10 -Python 3.4

___
Python tracker 

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



[issue43596] change assertRaises message when wrong exception is raised

2021-03-22 Thread R. Samuel Klatchko


New submission from R. Samuel Klatchko :

Right now, this code:

class FooError(Exception): pass
class BarError(Exception): pass

def test_me(self):
  with self.assertRaises(FooError):
raise BarError("something")

will have the error "BarError: something" with no indication that an exception 
was expected but just that we got the wrong one.

It would be help to change the message to something like:

  Expected exception of type FooError but exception BarError('something') was 
raised.

--
messages: 389328
nosy: rsk2
priority: normal
severity: normal
status: open
title: change assertRaises message when wrong exception is raised

___
Python tracker 

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



[issue43596] change assertRaises message when wrong exception is raised

2021-03-22 Thread Nathaniel Manista


Change by Nathaniel Manista :


--
nosy: +Nathaniel Manista

___
Python tracker 

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



[issue43591] Parser aborts on incomplete/incorrect unicode literals in interactive mode

2021-03-22 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



[issue43591] Parser aborts on incomplete/incorrect unicode literals in interactive mode

2021-03-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 123ff266cda9ad279106f20dca06ba114f6a9b8a by Pablo Galindo in 
branch 'master':
bpo-43591: Fix error location in interactive mode for errors at the end of the 
line (GH-24973)
https://github.com/python/cpython/commit/123ff266cda9ad279106f20dca06ba114f6a9b8a


--

___
Python tracker 

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



[issue26403] Catch FileNotFoundError in socketserver.DatagramRequestHandler

2021-03-22 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10 -Python 3.5

___
Python tracker 

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



[issue12762] OSError msg should display symbolic error codes

2021-03-22 Thread Zackery Spytz


Zackery Spytz  added the comment:

This is a duplicate of bpo-2920 (which has a PR).

--
nosy: +ZackerySpytz
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> Patch to print symbolic value of errno in OSError.__str__()

___
Python tracker 

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



[issue43596] change assertRaises message when wrong exception is raised

2021-03-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue43181] Python macros don’t shield arguments

2021-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

Me:
> I don't think that PR 24533 should be backported to Python 3.8 and Python 
> 3.9. I prefer to avoid any risk of regression, and so only change Python 3.10.

Sometimes. I'm wise :-D This change broken 2 extension modules which rely on 
the fact that the macro magically add parenthesis:

python-cvxopt: "if Matrix_Check((PyObject *)val)" with: "#define 
Matrix_Check(self) PyObject_TypeCheck(self, &matrix_tp)"
https://bugzilla.redhat.com/show_bug.cgi?id=1941557
PR proposed: https://github.com/cvxopt/cvxopt/pull/190

python-Bottleneck: "if PyArray_Check(a_obj) {" with: "#define PyArray_Check(op) 
PyObject_TypeCheck(op, &PyArray_Type)"
https://bugzilla.redhat.com/show_bug.cgi?id=1941559

"if func(...) {" is not valid C code, but the old macro added magically 
parenthesis!

It's hard to say if the Python change is a backward incompatible or not... I 
prefer to keep it and fix the few broken C extensions.

--

___
Python tracker 

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



[issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver

2021-03-22 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy: +gvanrossum

___
Python tracker 

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



[issue43010] @functools.wraps and abc.abstractmethod interoperability

2021-03-22 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

> other attributes will not be copied

The signature of wraps() is

wraps(wrapped, assigned=('__module__', '__name__', '__qualname__', 
'__doc__', '__annotations__'), updated=('__dict__',))

Passing the updated=() will prevent the __dict__ from being updated, but those 
other attributes will still be assigned to:

>>> from functools import wraps
>>> def f(x: int) -> int:
... "Square of a number"
... return x ** 2
...
>>> @wraps(f, updated=())
... def g(*args, **kwargs):
... return f(*args, **kwargs)
...
>>> help(g)
Help on function f in module __main__:

f(x: int) -> int
Square of a number

> This is an interoperability bug

This is probably somewhat subjective, but I think the current behavior is okay: 
copy all of the attributes of the wrapped function into the wrapper. That's 
predictable, well-specified behavior, even if it has unexpected consequences in 
some situations -- I would say unusual situations, since 90% of the time I've 
seen @wraps used is in making custom decorators, where you really do mean to 
copy *all* of the attributes of the old function into the new one, and never 
think of the wrapped function again.

My thinking is also that to add a special case for abstract methods in 
functools would be to unnecessarily couple the functools module to 
implementation details of the ABC module. If someone using the ABC module wants 
to not update the __dict__ when using functools.wraps, there's already an easy 
switch for that, and it's completely orthogonal to what the __dict__ contains.

For an interesting precedent, @abstractclassmethod was created in 
https://bugs.python.org/issue5867 to solve a similar (I think) interoperability 
problem between @abstractmethod and @classmethod rather than adding a special 
case to @classmethod.

I would be interested in hearing if others want something to change about 
wraps().

--

___
Python tracker 

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



[issue43555] Location of SyntaxError with new parser missing (after continuation character)

2021-03-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 96eeff516204b7cc751103fa33dcc665e387846e by Pablo Galindo in 
branch 'master':
bpo-43555: Report the column offset for invalid line continuation character 
(GH-24939)
https://github.com/python/cpython/commit/96eeff516204b7cc751103fa33dcc665e387846e


--

___
Python tracker 

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



[issue43555] Location of SyntaxError with new parser missing (after continuation character)

2021-03-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue17792] Unhelpful UnboundLocalError due to del'ing of exception target

2021-03-22 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue15751] [subinterpreters] Make the PyGILState API compatible with subinterpreters

2021-03-22 Thread Gabriel Amine Eddine


Change by Gabriel Amine Eddine :


--
nosy: +gabrielhae

___
Python tracker 

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



[issue42444] pathlib.PurePath properties annotated with .. data directive

2021-03-22 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
nosy: +ZackerySpytz
nosy_count: 6.0 -> 7.0
pull_requests: +23736
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24977

___
Python tracker 

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



[issue43592] test_importlib: test_multiprocessing_pool_circular_import() fails with "Too many open files" error on os.pipe()

2021-03-22 Thread Ned Deily


Ned Deily  added the comment:

FWIW, I don't recall ever seeing a "too many open files" failure for 
test_importlib on any of my macOS systems.

--
nosy: +ned.deily

___
Python tracker 

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



[issue43555] Location of SyntaxError with new parser missing (after continuation character)

2021-03-22 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 994a519915bff4901abaa7476e2b91682dea619a by Miss Islington (bot) 
in branch '3.9':
bpo-43555: Report the column offset for invalid line continuation character 
(GH-24939) (#24975)
https://github.com/python/cpython/commit/994a519915bff4901abaa7476e2b91682dea619a


--

___
Python tracker 

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



[issue43555] Location of SyntaxError with new parser missing (after continuation character)

2021-03-22 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



[issue43591] Parser aborts on incomplete/incorrect unicode literals in interactive mode

2021-03-22 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Thanks, Pablo!

--

___
Python tracker 

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



[issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver

2021-03-22 Thread Vladimir Matveev


Vladimir Matveev  added the comment:

>Currently, super() is decoupled from the core language.  It is just a builtin 
>that provides customized attribute lookup.  This PR makes super() more tightly 
>integrated with the core language, treating it as if it were a keyword and 
>part of the grammar.  Also note, users can currently create their own versions 
>of super(), shadowing the builtin super().

This is true however:
- this patch does not block people from introducing custom version of `super` 
so this scenario still work. The idea was to streamline the common case
- based on digging into Instagram codebase and its transitive dependencies 
(which is reasonably large amount of code) all spots where `super()` appear in 
sources assume `super` to be builtin and for a pretty common use-case its cost 
is noticeable in profiler.
- zero-argument `super()` still a bit magical since it requires compiler 
support to create cell for `__class__` and assumes certain shape of the frame 
object so this patch is a step forward with a better compiler support and 
removing runtime dependency on the frame

> Do you have any evidence that the overhead of super() is significant in real 
> programs

I do see the non-negligible cost of allocation/initialization of `super` object 
in IG profiling data.

--

___
Python tracker 

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



[issue2920] Patch to print symbolic value of errno in OSError.__str__()

2021-03-22 Thread Eryk Sun


Change by Eryk Sun :


--
versions: +Python 3.10 -Python 3.9

___
Python tracker 

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



[issue43547] support ZIP files with zeroed out fields (e.g. for reproducible builds)

2021-03-22 Thread Felix C. Stegerman


Change by Felix C. Stegerman :


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

___
Python tracker 

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



[issue43547] support ZIP files with zeroed out fields (e.g. for reproducible builds)

2021-03-22 Thread Felix C. Stegerman


Felix C. Stegerman  added the comment:

I've created a draft PR; RFC :)

Also:

* setting the date to (1980,0,0,0,0,0) already works;
* the main issue seems to be that external_attr cannot be 0 atm.

--

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


Change by junyixie :


--
pull_requests: +23738
pull_request: https://github.com/python/cpython/pull/24971

___
Python tracker 

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



[issue43588] [Subinterpreters]: use static variable under building Python with --with-experimental-isolated-subinterpreters cause crash.

2021-03-22 Thread junyixie


Change by junyixie :


--
pull_requests: +23739
pull_request: https://github.com/python/cpython/pull/24972

___
Python tracker 

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



[issue43558] The dataclasses documentation should mention how to call super().__init__

2021-03-22 Thread Eric V. Smith


Change by Eric V. Smith :


--
pull_requests:  -23730

___
Python tracker 

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



[issue43558] The dataclasses documentation should mention how to call super().__init__

2021-03-22 Thread Eric V. Smith


Change by Eric V. Smith :


--
pull_requests:  -23731

___
Python tracker 

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



[issue43558] The dataclasses documentation should mention how to call super().__init__

2021-03-22 Thread Eric V. Smith


Change by Eric V. Smith :


--
keywords: +easy -patch
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



[issue43547] support ZIP files with zeroed out fields (e.g. for reproducible builds)

2021-03-22 Thread Christian Heimes


Christian Heimes  added the comment:

Hi,

thanks for looking into reproducible builds. I have a few suggestions:

- since it's a new feature, it cannot go into older releases.
- zeroed is not a self-explanatory term. I suggest to find a term that does 
describe the result, not the internal operation.
- I don't think you have to introduce a new argument at all. Instead you can 
provide a new method that creates a carefully crafted zipinfo object that 
results into zeroed arguments. That's how I implemented reproducible tar.bz2 
files.
- For full reproducible builds you may have to write files to zipfiles in a 
well-defined order.

--
components:  -IO
nosy: +christian.heimes
type:  -> enhancement
versions:  -Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver

2021-03-22 Thread Guido van Rossum


Guido van Rossum  added the comment:

This looks like a sensible idea to me. The safeguards to ensure that customized 
'super' still works seem reasonable to me. I have to admit that I sometimes 
refrain from using super() where I should because of the expense, so this would 
be welcome.

I do wonder -- is two-arg super() important enough to support it at all? Maybe 
the code would be somewhat simpler if the special opcodes were only generated 
for zero-arg super() calls.

--

___
Python tracker 

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



[issue43492] Upgrade to SQLite 3.35.3 in macOS and Windows

2021-03-22 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

FYI: https://www.sqlite.org/cgi/src/info/8de4cb984a4b019f:

"We anticipate 3.35.3 in a few days. Hopefully there will never be a need for 
3.35.4."

--
title: Upgrade to SQLite 3.35.2 in macOS and Windows -> Upgrade to SQLite 
3.35.3 in macOS and Windows

___
Python tracker 

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



[issue43420] Optimize rational arithmetics

2021-03-22 Thread Tim Peters


Tim Peters  added the comment:

This report is closed. Please open a different report.

We've already demonstrated that, as predicted, nothing can be said here without 
it being taken as invitation to open-ended discussion. So it goes, but it 
doesn't belong on _this_ report anymore.

--

___
Python tracker 

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



[issue43547] support ZIP files with zeroed out fields (e.g. for reproducible builds)

2021-03-22 Thread Christian Heimes


Christian Heimes  added the comment:

zinfo = zipfile.ZipInfo()
zinfo.date_time = (1980, 0, 0, 0, 0, 0)
zinfo.create_system = 0

external_attr == 0 may cause issues with permissions. I do something like this 
in my reproducible tarfile code:

if zinfo.isdir():
# 0755 + MS-DOS directory flag
zinfo.external_attr = 0o755 | 0x010
else:
zinfo.external_attr = 0o644

--

___
Python tracker 

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



[issue43563] Use dedicated opcodes to speed up calls/attribute lookups with super() as receiver

2021-03-22 Thread Mark Shannon


Mark Shannon  added the comment:

Numbers please.

What is "non-negligible cost of allocation/initialization" mean as a fraction 
of runtime?
What sort of speed up are you seeing on whole programs?

--

___
Python tracker 

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



  1   2   >