[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-18 Thread Carl Friedrich Bolz-Tereick


Carl Friedrich Bolz-Tereick  added the comment:

PyPy raises a RecursionError here, which sounds like an ok outcome. So simply 
checking for the recursion would also be a way of fixing this...

--
nosy: +Carl.Friedrich.Bolz

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-18 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Oh yeah -- Py_EnterRecursiveCall/Py_LeaveRecursiveCall in abstract_get_bases 
would be simpler. Also, the set approach also probably still c-stack overflows 
on

class C:
def __getattr__(self, attr):
class A: pass
class B: pass
A.__getattr__ = B.__getattr__ = C.__getattr__
return (A(), B())

issubclass(C(), int)

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue45506] Out of source tree builds failing on main - test_importlib others unreliable

2021-10-18 Thread Gregory P. Smith


New submission from Gregory P. Smith :

The behavior is odd, I don't really know how to characterize it other than 
something serious has gone wrong.  Memory corruption thus differing failures 
perhaps?  it seems like maybe a race condition?

on the main branch (i cannot reproduce this on 3.10 thankfully):

1) git checkout https://github.com/python/cpython.git upstream
2) mkdir b-u && cd b-u
3) ../upstream/configure --with-pydebug && make -j3 && ./python -m 
test.regrtest test_importlib

- sometimes it hangs forever.
- sometimes it crashes with a long list of error messages coming out of 
regrtest itself.  The crashes appear to happen in a child process so regrtest 
can continue and run other tests if you tell it to run more.  Sometimes it'll 
be an error about "import _frozenimport_lib as bootstrap" failing with 
sys.modules containing None. (Linux does that for me)  On macOS when it doesn't 
hang, I get a blowup from test_importlib/test_threaded_import.py.

I've reproduced this on Linux and macOS.  macOS alternates between a traceback 
blowup and hang with an occasional pass.  On Linux it is quite consistently a 
huge chain of stacktraces.

Linux:

```
0:00:00 load avg: 2.48 Run tests sequentially
0:00:00 load avg: 2.48 [1/1] test_importlib
Failed to import test module: test.test_importlib.builtin.test_finder
Traceback (most recent call last):
  File "/home/greg/oss/python/cpython/gpshead/Lib/importlib/__init__.py", line 
16, in 
import _frozen_importlib as _bootstrap
^^
ModuleNotFoundError: import of _frozen_importlib halted; None in sys.modules

During handling of the above exception, another exception occurred:

...  tons more  ...
```

Our buildbot fleet is not bloody looking.  Which is why I tried it on two 
different systems and OSes before reporting.  When I do a ./configure and run 
everything within the source tree it does not fail.  This is only for proper 
out-of-tree builds (which are what I always use - as should everybody).

Do our buildbots only do in-tree builds?

--
components: Build
messages: 404159
nosy: gregory.p.smith
priority: high
severity: normal
stage: needs patch
status: open
title: Out of source tree builds failing on main - test_importlib others 
unreliable
type: behavior
versions: Python 3.11

___
Python tracker 

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



[issue44926] [DOC] typing.get_type_hints() raises for type aliases with forward references

2021-10-18 Thread Irit Katriel


Change by Irit Katriel :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: typing.get_type_hints() raises for type aliases with forward references 
-> [DOC] typing.get_type_hints() raises for type aliases with forward references
type: crash -> 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



[issue45506] Out of source tree builds failing on main - test_importlib others unreliable

2021-10-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

for easy pasting:

git clone https://github.com/python/cpython.git upstream && \
mkdir b-u && cd b-u && \
../upstream/configure --with-pydebug && make -j3 && \
./python -m test.regrtest test_importlib

[change python to python.exe for macos, adjust -j as appropriate]

(if I can figure out git bisect command i'll start one before going to bed...)

(oh hey, i've got macOS producing the same error as Linux now somehow)

--

___
Python tracker 

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



[issue45506] Out of source tree builds failing on main - test_importlib others unreliable

2021-10-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

further down in the tracebacks in that situation:

```
  File "/Users/greg/oss/python/upstream/Lib/importlib/_bootstrap.py", line 887, 
in _fix_up_module
assert module.__file__ == __file__, (module.__file__, __file__)
^^^
AssertionError: ('/Users/greg/oss/python/upstream/Lib/zipimport.py', 
'/Users/greg/oss/python/b-u/../upstream/Lib/zipimport.py')
```

--

___
Python tracker 

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



[issue45506] Out of source tree builds failing on main - test_importlib others unreliable

2021-10-18 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +eric.snow

___
Python tracker 

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



[issue42222] Modernize integer test/conversion in randrange()

2021-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +27294
pull_request: https://github.com/python/cpython/pull/29021

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-18 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10
nosy_count: 1.0 -> 2.0
pull_requests: +27295
pull_request: https://github.com/python/cpython/pull/29015

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-18 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset fd03917786a9036ee87b7df604dfb260cc2420c9 by Dong-hee Na in branch 
'main':
bpo-45434: Include stdlib.h for specialize stat (GH-29015)
https://github.com/python/cpython/commit/fd03917786a9036ee87b7df604dfb260cc2420c9


--

___
Python tracker 

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



[issue45478] Send a patch to libexpat to solve _POSIX_C_SOURCE issue.

2021-10-18 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue35799] fix or remove smtpd.PureProxy

2021-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

The whole smtpd is now deprecated for removal in 3.12.

--
nosy: +iritkatriel
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45020] Freeze all modules imported during startup.

2021-10-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

could changes related to this be the cause of 
https://bugs.python.org/issue45506 ?

out of tree builds in main usually cannot pass key tests today.  they often 
hang or blow up with strange exceptions.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue45507] Small oversight in 3.11 gzip.decompress implementation with regards to backwards compatibility

2021-10-18 Thread Ruben Vorderman


New submission from Ruben Vorderman :

A 'struct.error: unpack requires a buffer of 8 bytes' is thrown when a gzip 
trailer is truncated instead of an EOFError such as in the 3.10 and prior 
releases.

--
components: Library (Lib)
messages: 404165
nosy: rhpvorderman
priority: normal
severity: normal
status: open
title: Small oversight in 3.11 gzip.decompress implementation with regards to 
backwards compatibility
type: behavior
versions: Python 3.11

___
Python tracker 

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



[issue45507] Small oversight in 3.11 gzip.decompress implementation with regards to backwards compatibility

2021-10-18 Thread Ruben Vorderman


Change by Ruben Vorderman :


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

___
Python tracker 

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



[issue45256] Remove the usage of the C stack in Python to Python calls

2021-10-18 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 70945d57e775b335eb58b734d82e68484063e835 by Mark Shannon in 
branch 'main':
bpo-45256: Avoid C calls for most Python to Python calls. (GH-28937)
https://github.com/python/cpython/commit/70945d57e775b335eb58b734d82e68484063e835


--

___
Python tracker 

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



[issue45506] Out of source tree builds failing on main - test_importlib others unreliable

2021-10-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

git bisect on Linux yielded this culprit change:


```
79cf20e48d0b5d69d9fac2a0204b5ac2c366066a is the first bad commit
commit 79cf20e48d0b5d69d9fac2a0204b5ac2c366066a
Author: Eric Snow 
Date:   Thu Oct 14 15:32:18 2021 -0600

bpo-21736: Set __file__ on frozen stdlib modules. (gh-28656)
```

...
Running a git bisect ritual on macOS wasn't helpful, test_importlib out of tree 
too often simply hangs there (going much further back).  Apparently more than 
one possible issue at play here.  Lets let this issue be for the Linux one.

--

___
Python tracker 

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



[issue21736] Add __file__ attribute to frozen modules

2021-10-18 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

That appears to have caused https://bugs.python.org/issue45506

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue45507] Small oversight in 3.11 gzip.decompress implementation with regards to backwards compatibility

2021-10-18 Thread Ruben Vorderman


Ruben Vorderman  added the comment:

It turns out there is a bug where FNAME and/or FCOMMENT flags are set in the 
header, but no error is thrown when NAME and COMMENT fields are missing.

--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-18 Thread Thomas Wouters


Thomas Wouters  added the comment:

Victor, what's the benefit of doing this work? Are there real problems this 
fixes? I'm worried about the churn in third-party extensions, examples, 
tutorials, etc, especially for audiences that upon seeing a compiler error 
won't immediately realise they need to include stdlib.h themselves. (Also, 
since Python.h sets things like _POSIX_C_SOURCE and _XOPEN_SOURCE, including 
them in the wrong order can produce even more confusing errors, or errors that 
only appear on some platforms.)

--
nosy: +twouters

___
Python tracker 

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



[issue45508] Specialize INPLACE_ADD

2021-10-18 Thread Dennis Sweeney


New submission from Dennis Sweeney :

I ran on WSL with PGO and got "1.00x faster":
https://gist.github.com/sweeneyde/41a76356e875e2a98d16ce5410ab41c0

My benchmarking doesn't seem particularly reliable, so someone else should 
probably verify.

Great specialization stats, except for telco, which uses decimal += decimal.

bm_fannkuch:
inplace_add.specialization_success : 23
inplace_add.specialization_failure : 3
inplace_add.hit : 7968285
inplace_add.deferred : 198
inplace_add.miss : 39
inplace_add.deopt : 3
inplace_add.unquickened : 168

bm_nbody:
inplace_add.specialization_success : 27
inplace_add.specialization_failure : 3
inplace_add.hit : 3600615
inplace_add.deferred : 198
inplace_add.miss : 39
inplace_add.deopt : 3
inplace_add.unquickened : 178

bm_spectral_norm:
inplace_add.specialization_success : 24
inplace_add.specialization_failure : 5
inplace_add.hit : 2684690
inplace_add.deferred : 326
inplace_add.miss : 20843
inplace_add.deopt : 3
inplace_add.unquickened : 171

bm_telco:
inplace_add.specialization_success : 21
inplace_add.specialization_failure : 18537
inplace_add.hit : 597
inplace_add.deferred : 1186282
inplace_add.miss : 39
inplace_add.deopt : 3
inplace_add.unquickened : 187

--
messages: 404171
nosy: Dennis Sweeney
priority: normal
severity: normal
status: open
title: Specialize INPLACE_ADD

___
Python tracker 

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



[issue45508] Specialize INPLACE_ADD

2021-10-18 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-18 Thread STINNER Victor


STINNER Victor  added the comment:

I reopen the issue.

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

___
Python tracker 

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



[issue32291] Value error for string shared memory in multiprocessing

2021-10-18 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner
status: pending -> open

___
Python tracker 

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



[issue30774] list_repr not safe against concurrent mutation

2021-10-18 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



[issue32291] Value error for string shared memory in multiprocessing

2021-10-18 Thread Irit Katriel


Change by Irit Katriel :


--
status: open -> pending

___
Python tracker 

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



[issue45413] Add install scheme for virtual environments

2021-10-18 Thread Lumír Balhar

Change by Lumír Balhar :


--
nosy: +frenzy

___
Python tracker 

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



[issue45460] distutils.sysconfig.get_python_lib() does not respect sysconfig/distutils install schemes

2021-10-18 Thread Lumír Balhar

Change by Lumír Balhar :


___
Python tracker 

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



[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-18 Thread STINNER Victor


STINNER Victor  added the comment:

> * Cython: https://github.com/cython/cython/pull/4411

Merged:

* 0.29.x: 
https://github.com/cython/cython/commit/cbddad23e30ea6d31e0178a4c623f1f6d75452c3
* master: 
https://github.com/cython/cython/commit/4df1103bd30143ce022b07f98a2f62678d417e92

--

___
Python tracker 

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



[issue45434] [C API] Clean-up the Python.h header file

2021-10-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27298
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/29027

___
Python tracker 

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



[issue45509] Gzip header corruption not properly checked.

2021-10-18 Thread Ruben Vorderman


New submission from Ruben Vorderman :

The following headers are currently allowed while being wrong:

- Headers with FCOMMENT flag set, but with incomplete or missing COMMENT bytes.
- Headers with FNAME flag set, but with incomplete or missing NAME bytes
- Headers with FHCRC set, the crc is read, but not checked.

--
components: Library (Lib)
messages: 404174
nosy: rhpvorderman
priority: normal
severity: normal
status: open
title: Gzip header corruption not properly checked.
type: behavior
versions: Python 3.11

___
Python tracker 

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



[issue45420] Python 3.10 final installation failure

2021-10-18 Thread Steve Dower


Steve Dower  added the comment:

It's not really complicated, it's just a little difficult to find the right 
files you need.

> Running from the Add Remove Programs entry prompts for admin access.

Which clearly shows it was previously installed by an admin, and so you'll need 
that to remove/repair/upgrade it properly. If you aren't an administrator on 
your machine, you'll need to find out who is and ask them to do it.

> Directly running "repair" in the rc2 installer with admin says "No Python 
> 3.10 installation was detected"

This generally means you need a different copy of the installer. There should 
only be 32-bit and 64-bit ones floating around, but it may be that you actually 
need RC1 and not RC2? They are all subtly different (most notably in their 
primary UUID ;) ) and won't repair each other (which would be an 
upgrade/downgrade, which should work when you haven't deleted all the files 
manually).

Otherwise, there used to be tools out there that could delete all the 
registrations in the Windows installer database, but I haven't had to use one 
in years and I have no idea which would work well. If you can remove all the 
registration entries (which you can't do by hand, trust me, you need a clever 
tool) then you should be able to install a new version without hitting these 
issues.

--

___
Python tracker 

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



[issue45510] Specialize BINARY_SUBTRACT

2021-10-18 Thread Dong-hee Na


New submission from Dong-hee Na :

https://github.com/faster-cpython/ideas/issues/100

--
messages: 404176
nosy: corona10
priority: normal
severity: normal
status: open
title: Specialize BINARY_SUBTRACT
type: performance
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



[issue45510] Specialize BINARY_SUBTRACT

2021-10-18 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue26387] Crash calling sqlite3_close with invalid pointer

2021-10-18 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

FYI: We've been using sqlite3_close_v2(), when available, since 2017 (see 
86a670543ff97d52fd9b8ca0477f8b6d27ee946d), but we now call it with GIL held.

I'm leaning towards closing this as out-of-date. There is no reproducer, there 
has been no more similar bug reports, and there has been no activity on this 
issue.


Possible improvement of connection_close():
  1. save database pointer to temporary variable
  2. clear self->db
  3. call sqlite3_close_v2() (without holding GIL)

diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index d6d1fa8bf2..47c0267e89 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -301,9 +301,12 @@ static void
 connection_close(pysqlite_Connection *self)
 {
 if (self->db) {
-int rc = sqlite3_close_v2(self->db);
-assert(rc == SQLITE_OK), (void)rc;
+sqlite *db = self->db;
 self->db = NULL;
+Py_BEGIN_ALLOW_THREADS
+int rc = sqlite3_close_v2(db);
+assert(rc == SQLITE_OK), (void)rc;
+Py_END_ALLOW_THREADS
 }
 }
 }

--
nosy: +erlendaasland

___
Python tracker 

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



[issue26387] Crash calling sqlite3_close with invalid pointer

2021-10-18 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

>From https://sqlite.org/c3ref/close.html:

  If sqlite3_close_v2() is called with unfinalized prepared statements,
  unclosed BLOB handlers, and/or unfinished sqlite3_backups, it returns
  SQLITE_OK regardless, but instead of deallocating the database connection
  immediately, it marks the database connection as an unusable "zombie" and
  makes arrangements to automatically deallocate the database connection after
  all prepared statements are finalized, all BLOB handles are closed, and all
  backups have finished. The sqlite3_close_v2() interface is intended for use
  with host languages that are garbage collected, and where the order in which
  destructors are called is arbitrary.


Also:

  Calling sqlite3_close() or sqlite3_close_v2() with a NULL pointer argument
  is a harmless no-op.

--

___
Python tracker 

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



[issue45509] Gzip header corruption not properly checked.

2021-10-18 Thread Ruben Vorderman


Change by Ruben Vorderman :


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

___
Python tracker 

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



[issue45507] Small oversight in 3.11 gzip.decompress implementation with regards to backwards compatibility

2021-10-18 Thread Ruben Vorderman


Change by Ruben Vorderman :


--
pull_requests: +27301
pull_request: https://github.com/python/cpython/pull/29029

___
Python tracker 

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



[issue45511] input() method limited to 4095 characters on *NIX

2021-10-18 Thread Romuald Brunet


New submission from Romuald Brunet :

When run in non-interactive mode and with a TTY stdin, the input() method will 
not read more than 4095 characters

Simple example:

>>> foo = input()  # paste a 5000 character pasteboard (one line)
>>> print(len(foo))
4095

Note that this will **not** happen when using an interactive shell (using 
python -i on the same script will not have the 4095 limit)

I've traced the issue (I think) to the fgets function called from my_fgets in 
myreadline.c, but I have no clue as to how one might fix this.

--
components: Interpreter Core
messages: 404179
nosy: Romuald
priority: normal
severity: normal
status: open
title: input() method limited to 4095 characters on *NIX
type: behavior
versions: Python 3.10, 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



[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2021-10-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I was CC-ed on a response to a user who reported module shadowing as a security 
issue.  If it is disabled by default, we could add an option to enable for 
intentional experiments.  See idle.py.

--

___
Python tracker 

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



[issue26143] Ensure that IDLE's stdlib imports are from the stdlib

2021-10-18 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I believe standard interpreter only adds '' to path after its startup.  But it 
might be vulnerable to shadowing of delayed imports.

--

___
Python tracker 

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



[issue45512] [sqlite3] simplify "isolation level"

2021-10-18 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

While working on bpo-45126 / GH-28227 (and while working on the AC conversion, 
bpo-40956), I've been slightly frustrated on the implementation of sqlite3 
"isolation level". The code is messy, and we've got two connection members that 
carry pretty much the same type of information (self->isolation_level, and 
self->begin_statement).

I would like to make the following enhancements:
  - merge 'isolation_level' and 'begin_statement' members in some kind of way
  - split pysqlite_connection_set_isolation_level():
+ one method for parsing and storing the 'isolation_level' member
+ one method for carrying out any needed SQLite API operation

This should result in a cleaner connection __init__() method.


Another slightly related performance enhancement could be to cache the "begin" 
(and "commit") statements as sqlite3_stmt pointers on the connection object, 
but that is a digression.

--
components: Extension Modules
messages: 404182
nosy: erlendaasland
priority: low
severity: normal
status: open
title: [sqlite3] simplify "isolation level"
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



[issue37295] Possible optimizations for math.comb()

2021-10-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +27302
pull_request: https://github.com/python/cpython/pull/29030

___
Python tracker 

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



[issue45490] [meta][C API] Avoid C macro pitfalls and usage of static inline functions

2021-10-18 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

+1!

See also bpo-43502

--
nosy: +erlendaasland

___
Python tracker 

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



[issue37295] Possible optimizations for math.comb()

2021-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Here is more optimized PR inspired by PR 29020. It would be too long to explain 
how PR 29020 can be improved, so I write a new PR.

Basically it implements Raymond's idea #1, but supports n>62 for smaller k.

How to calculate limits:

import math
n = m = 2**64
k = 1
while True:
nmax = int(math.ceil((m * math.factorial(k-1)) ** (1/k) + (k-1)/2)) + 100
n = min(n, nmax)
while math.comb(n, k) * k >= m:
n -= 1
if n < 2*k: break
print(k, n)
k += 1

--
versions: +Python 3.11 -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



[issue45490] [meta][C API] Avoid C macro pitfalls and usage of static inline functions

2021-10-18 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Previous discussion on Discourse:

https://discuss.python.org/t/what-to-do-with-unsafe-macros/7771

--

___
Python tracker 

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



[issue45513] PIP error Cannot call rmtree on a symbolic link should report the lilnk

2021-10-18 Thread Timothe Litt


New submission from Timothe Litt :

Debugging this would be a whole lot easier if the symlink in question was in 
the error message... (Not to mention that "successfully uninstalled the 
installer followed by why the new one can't be installed isn't a good thing)

pip3 install --upgrade pip
Requirement already satisfied: pip in /usr/local/lib/python3.10/site-packages 
(21.2.3)
Collecting pip
  Using cached pip-21.3-py3-none-any.whl (1.7 MB)
Installing collected packages: pip
  Attempting uninstall: pip
Found existing installation: pip 21.2.3
Uninstalling pip-21.2.3:
  Successfully uninstalled pip-21.2.3
ERROR: Could not install packages due to an OSError: Cannot call rmtree on a 
symbolic link

--
components: Installation
messages: 404186
nosy: tlhackque
priority: normal
severity: normal
status: open
title: PIP error Cannot call rmtree on a symbolic link should report the lilnk
type: enhancement
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



[issue45330] dulwich_log performance regression in 3.10

2021-10-18 Thread Ken Jin


Ken Jin  added the comment:

Considering both Inada-san and I can't repro this on Linux and Windows 
respectively, I'm closing this and blaming code placement or some magic. Thanks 
everyone.

--
resolution:  -> rejected
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



[issue44191] Getting an ImportError DLL load failed while importing _ssl

2021-10-18 Thread Irit Katriel


Change by Irit Katriel :


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



[issue45506] Out of source tree builds failing on main - test_importlib others unreliable

2021-10-18 Thread Eric Snow


Eric Snow  added the comment:

I'm looking into it.

--

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 1.0 -> 2.0
pull_requests: +27303
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29031

___
Python tracker 

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



[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +27304
pull_request: https://github.com/python/cpython/pull/29032

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-18 Thread Dong-hee Na


Dong-hee Na  added the comment:

@serhiy
what is the main concern about this feature?

--

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-18 Thread Dong-hee Na


Dong-hee Na  added the comment:

if you think that this feature is not usable, I will let gdbms maintainers 
write the idea to the Python-dev mailing list if they want to enable this 
feature.

--

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
nosy: +kj

___
Python tracker 

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



[issue45506] Out of source tree builds failing on main - test_importlib others unreliable

2021-10-18 Thread Eric Snow


Eric Snow  added the comment:

> Do our buildbots only do in-tree builds?

>From what I understand, we do not have any (stable?) buildbots that check 
>out-of-tree builds.

FWIW, in the last month I started testing my changes out-of-tree before 
merging, after Victor once pointed out that I had broken such builds.  Clearly 
there must be a gap in what I'm doing.

--

___
Python tracker 

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



[issue45506] Out of source tree builds failing on main - test_importlib others unreliable

2021-10-18 Thread Ned Deily


Ned Deily  added the comment:

@gps, on macOS, you may need to bump the open file descriptors limit for the 
test process, i.e. ulimit -n 1000. I build and run out-of-tree builds all the 
time on macOS.

--
nosy: +ned.deily

___
Python tracker 

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



[issue45513] PIP error Cannot call rmtree on a symbolic link should report the lilnk

2021-10-18 Thread Ned Deily


Ned Deily  added the comment:

This appears to be an issue with pip. You should report the issue to the pip 
project: https://github.com/pypa/pip/issues/

--
nosy: +ned.deily
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



[issue39679] functools: singledispatchmethod doesn't work with classmethod

2021-10-18 Thread Alex Waygood


Change by Alex Waygood :


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

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Ned Deily


Change by Ned Deily :


--
nosy: +ned.deily

___
Python tracker 

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



[issue45459] Limited API support for Py_buffer

2021-10-18 Thread Christian Heimes


Change by Christian Heimes :


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

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Ken Jin


Ken Jin  added the comment:

@ux, could you please provide more information? What platform are you on, and 
what compiler version produces this error?

--
nosy: +christian.heimes

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Inada: adding you as you merged the patch that made the switch 
optparse->argparse.

--
nosy: +methane

___
Python tracker 

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



[issue43537] interpreter crashes when handling long text in input()

2021-10-18 Thread Irit Katriel


Change by Irit Katriel :


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



[issue42935] Pickle can't import builtins at exit

2021-10-18 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> wont fix
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



[issue36281] OSError: handle is closed for ProcessPoolExecutor and run_in_executor

2021-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

I don't get the error on 3.11, and I think it may have been fixed under 
Issue39104.

--
nosy: +iritkatriel
resolution:  -> duplicate
status: open -> pending
superseder:  -> ProcessPoolExecutor hangs on shutdown nowait with pickling 
failure

___
Python tracker 

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



[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-10-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 034f607906de6e375cc9a98cc3b09f6d56f8be10 by Victor Stinner in 
branch 'main':
bpo-43760: Rename _PyThreadState_DisableTracing() (GH-29032)
https://github.com/python/cpython/commit/034f607906de6e375cc9a98cc3b09f6d56f8be10


--

___
Python tracker 

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



[issue45427] importlib.readers.MultiplexedPath

2021-10-18 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Thanks Dave for closing. I would recommend in the future if you have packaging 
questions to bring them to packaging problems repo as indicated at 
https://packaging.python.org/support/#how-to-get-support.

Glad to hear that `as_file` promised to do what you need. Do be aware that it 
doesn't yet support a directory of files (only individual files), a known 
deficiency (https://github.com/python/importlib_resources/issues/228).

I don't have any good advice on separating Python and non-Python code in your 
package. You're right that the current interfaces for supporting package 
resources are specifically designed around resources in a Python package (aka 
package_data).

I agree that there may not be a robust way to locate "data_files". It sounds 
like you have a use-case that's not well served by the current implementation. 
I'd recommend to file a report describing a detailed minimal example of the 
use-case you have and what you'd like to see (in packaging-problems; maybe 
search if someone's already reported). One thing you'll want to answer is where 
do you expect these files to be installed if not in the python package?

Thanks and good luck!

--

___
Python tracker 

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



[issue37722] imaplib crashes when trying to read a letter from an imap server imaps.почта.рус

2021-10-18 Thread Irit Katriel

New submission from Irit Katriel :

Changing type because crash typically refers to segfault or hang and not an 
exception.

It doesn't seem possible to connect to imaps.почта.руc anymore.  Is there 
another way to reproduce this problem?

--
nosy: +iritkatriel
type: crash -> behavior

___
Python tracker 

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



[issue45452] Support crash tolerance feature for gdbm module

2021-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The main concern is that it is not clear how to use this feature, and if it is 
not clear, it will not be used. I am not even sure that it is Pythonic, because 
I do not know how to use it. For example, can it be used to implement 
transactions? How it works with multithreading and multiprocessing if works at 
all? Does it restore after failure automatically or needs some user's action? 
And how do user can know that some actions are required?

--

___
Python tracker 

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



[issue43668] Segfault with for fresh ubuntu 20.04 install

2021-10-18 Thread Irit Katriel


Change by Irit Katriel :


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



[issue45459] Limited API support for Py_buffer

2021-10-18 Thread Christian Heimes


Christian Heimes  added the comment:

CC Antoine for his expertise of the buffer protocol

Opaque Py_Buffer and PyObject structs will require a different approach and 
prevent some optimizations. The consumer will have to malloc() a Py_buffer 
struct on the heap. In non-trivial cases the producer (exporter) may have to 
malloc() another blob and store it in Py_buffer.internal [1]. I'm not 
particularly worried about the performance of malloc here.

[1] 
https://docs.python.org/3/c-api/buffer.html?highlight=pybuffer#c.Py_buffer.internal

--
nosy: +pitrou

___
Python tracker 

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



[issue36581] __dir__ on unittest.mock not safe for all spec types

2021-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

Changing type as crash typically refers to segfault or hang or the like, and 
not an exception.

Reproduced on 3.11.

--
nosy: +iritkatriel
type: crash -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, 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



[issue35828] test_multiprocessing_fork: segmentation error in PyDict_GetItem on AIX

2021-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

3.8 is no longer being maintained. Is this an issue on 3.9+?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue24319] Crash during "make coverage-report"

2021-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

3.6 is no longer maintained. Is this still an issue on 3.9+?

--
nosy: +iritkatriel
status: open -> pending

___
Python tracker 

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



[issue45514] Deprecate legacy functions from importlib.resources (importlib_resources 5.3)

2021-10-18 Thread Jason R. Coombs


New submission from Jason R. Coombs :

[importlib_resources 
5.3](https://importlib-resources.readthedocs.io/en/latest/history.html#v5-3-0), 
deprecates the functions in _legacy. Let's introduce that deprecation in 
CPython also.

In addition to merging the changes from importlib_resources, this change will 
require some updates to documentation.

--
assignee: jaraco
components: Library (Lib)
messages: 404205
nosy: FFY00, jaraco
priority: normal
severity: normal
status: open
title: Deprecate legacy functions from importlib.resources (importlib_resources 
5.3)
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



[issue40379] multiprocessing's default start method of fork()-without-exec() is broken

2021-10-18 Thread wim glenn


Change by wim glenn :


--
nosy: +wim.glenn

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Ned Deily


Ned Deily  added the comment:


New changeset 6a533a423869e28d9086cf4d79029f59e9eec916 by andrei kulakov in 
branch 'main':
bpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py (GH-29031)
https://github.com/python/cpython/commit/6a533a423869e28d9086cf4d79029f59e9eec916


--

___
Python tracker 

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



[issue45514] Deprecate legacy functions from importlib.resources (importlib_resources 5.3)

2021-10-18 Thread Jason R. Coombs


Change by Jason R. Coombs :


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

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45515] Add reference to zoneinfo in the datetime module documetnation

2021-10-18 Thread Paul Ganssle


New submission from Paul Ganssle :

Right now the datetime documentation recommends using `dateutil.tz` for IANA 
time zones, but we should update this to point to `zoneinfo`.

--
assignee: p-ganssle
components: Documentation
messages: 404207
nosy: p-ganssle
priority: low
severity: normal
status: open
title: Add reference to zoneinfo in the datetime module documetnation
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



[issue37295] Possible optimizations for math.comb()

2021-10-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Microbenchmarks:

$ ./python -m pyperf timeit -s 'from math import comb' '[comb(n, k) for n in 
range(63) for k in range(n+1)]'
Mean +- std dev: 1.57 ms +- 0.07 ms -> 209 us +- 11 us: 7.53x faster

$ ./python -m pyperf timeit -s 'from math import comb' 'comb(62, 31)'
Mean +- std dev: 2.95 us +- 0.14 us -> 296 ns +- 11 ns: 9.99x faster

$ ./python -m pyperf timeit -s 'from math import comb' 'comb(110, 15)'
Mean +- std dev: 1.33 us +- 0.06 us -> 95.8 ns +- 3.1 ns: 13.86x faster

$ ./python -m pyperf timeit -s 'from math import comb' 'comb(1449, 7)'
Mean +- std dev: 689 ns +- 33 ns -> 59.0 ns +- 3.2 ns: 11.69x faster

$ ./python -m pyperf timeit -s 'from math import comb' 'comb(3329022, 3)'
Mean +- std dev: 308 ns +- 19 ns -> 57.2 ns +- 4.2 ns: 5.39x faster

Now I want to try to optimize for larger arguments. Perhaps using recursive 
formula C(n, k) = C(n, j)*C(n-j, k-j)//C(k, j) where j=k//2 could help.

--

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread miss-islington


miss-islington  added the comment:


New changeset b1949e0b58714724a3105cad3ad1b61384688da7 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-45221: Fix handling of LDFLAGS and CPPFLAGS options in setup.py 
(GH-29031) (GH-29037)
https://github.com/python/cpython/commit/b1949e0b58714724a3105cad3ad1b61384688da7


--

___
Python tracker 

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



[issue45515] Add reference to zoneinfo in the datetime module documetnation

2021-10-18 Thread Paul Ganssle


Change by Paul Ganssle :


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

___
Python tracker 

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



[issue25066] Better repr for multiprocessing.synchronize objects

2021-10-18 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Nihir: in synchronize.py, only Barrier inherits from threading.Barrier, as far 
as I can see. Other classes inherit from `object`.

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44210] Make importlib.metadata._meta.PackageMetadata public

2021-10-18 Thread Filipe Laíns

Change by Filipe Laíns :


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



[issue45516] Add protocol description to the Traversable and TraversableResources documentation

2021-10-18 Thread Filipe Laíns

Change by Filipe Laíns :


--
assignee: docs@python
components: Documentation
nosy: FFY00, docs@python
priority: normal
severity: normal
status: open
title: Add protocol description to the Traversable and TraversableResources 
documentation

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report, @ux, and thanks for the PR, Andrei! I've backported the 
fix for release in 3.10.1 but I think it's pretty late in 3.9's release cycle 
and we've lived this long with the issue.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -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



[issue45516] Add protocol description to the Traversable and TraversableResources documentation

2021-10-18 Thread Filipe Laíns

Change by Filipe Laíns :


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

___
Python tracker 

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



[issue45221] Linker flags starting with -h breaks setup.py (regression)

2021-10-18 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I agree re: 3.9, thanks Ned!

--

___
Python tracker 

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



[issue11275] Linking to gcc's gomp causes crash later.

2021-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

Please create a new issue if you see the problem on a current python version.

--
nosy: +iritkatriel
resolution:  -> out of date
stage: test needed -> 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



[issue19459] Python does not support the GEORGIAN-PS charset

2021-10-18 Thread Tal Einat


Tal Einat  added the comment:

With recent versions of Python (e.g. 3.9) this no longer causes a crash. Python 
apparently falls back to UTF-8, at least on my system:

$ LANG=ka_GE.georgianps python3.9
Python 3.9.7 (default, Sep  9 2021, 23:20:13) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale; print(locale.getpreferredencoding())
UTF-8

I'm marking this as fixed. If someone still has issues with this encoding, 
please open a new issue with up-to-date information.

--
nosy: +taleinat
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue34708] Odd crashes/freezes when sys.stdout.shell.console is typed

2021-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

Terry, I don't see any PseudoOutputFile in the current codebase. Is this out of 
date?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue33713] memoryview can set an exception in tp_clear

2021-10-18 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.6, 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



[issue26626] test_dbm_gnu

2021-10-18 Thread Zachary Ware


Zachary Ware  added the comment:

Judging by the error message ("Device or resource busy:"), it seems likely to 
me that NFS was the culprit here.  The fact that the tests passed when run 
alone may point to an issue with the way tests were run as a group, but this 
has changed significantly since 2016.

If this can still be reproduced with modern versions of everything involved, it 
may be worth opening a new issue.  In the meantime, I'm closing this as out of 
date.

--
nosy: +zach.ware
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45517] TarFile.add skips files when tarfile name matches a directory

2021-10-18 Thread Jesse Kinkead


New submission from Jesse Kinkead :

tarfile.open has a "name" parameter that can be used to open a file for reading 
or writing in the local filesystem. The documentation is unclear what the 
purpose is if providing a "fileobj" parameter as well, but it has very 
surprising behavior when the name matches an existing directory.

Specifically, when you provide a "fileobj" for writing and provide a "name" 
that matches an existing directory, calling .add() on that directory will have 
it (and any child files) to be silently skipped.

The desired behavior is either to have the files be added (consistent with 
"name" being totally ignored), or to have it be an error to provide such a 
"name" value (either one that matches an existing directory, or to provide one 
at all when using "fileobj").

--
components: Library (Lib)
files: repro.py
messages: 404217
nosy: jkinkead
priority: normal
severity: normal
status: open
title: TarFile.add skips files when tarfile name matches a directory
versions: Python 3.8
Added file: https://bugs.python.org/file50367/repro.py

___
Python tracker 

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



[issue32629] PyImport_ImportModule occasionally cause access violation

2021-10-18 Thread Irit Katriel


Irit Katriel  added the comment:

This looks like you are accessing memory that has been corrupted, which can 
happen in any number of ways. I am closing this because there isn't enough 
information to do anything about it.

If you can show us how to reproduce the crash, and it occurs on a current 
version of python (>= 3.9), then please create a new issue.

--
nosy: +iritkatriel
resolution:  -> rejected
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



[issue45517] TarFile.add skips files when tarfile name matches a directory

2021-10-18 Thread Ethan Furman


Change by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue15251] new.code and new.function crashes Python iterpretter

2021-10-18 Thread Tal Einat


Tal Einat  added the comment:

I couldn't reproduce this on the latest main branch with an updated version of 
the code sample (see attached repro.py). I also couldn't get such a crash with 
some variations of this.

I'm marking this as fixed for now. We can re-open this if anyone runs into an 
up-to-date case of this crash.

--
nosy: +taleinat
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
Added file: https://bugs.python.org/file50368/repro.py

___
Python tracker 

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



[issue34192] FunctionType.__new__ can generate functions that immediately crash

2021-10-18 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

>From 
>https://github.com/python/cpython/blob/main/Lib/test/crashers/bogus_code_obj.py
> :


"""
Broken bytecode objects can easily crash the interpreter.

This is not going to be fixed.  It is generally agreed that there is no
point in writing a bytecode verifier and putting it in CPython just for
this.  Moreover, a verifier is bound to accept only a subset of all safe
bytecodes, so it could lead to unnecessary breakage.
"""

Since this is messing with implementation details of code objects, I'll close 
this as "won't fix".

--
nosy: +Dennis Sweeney
resolution:  -> wont fix
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



  1   2   >