[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-01-03 Thread Arie Bovenberg


Arie Bovenberg  added the comment:

@jaraco thanks for your quick response.

In short: __slots__ allows class layout to be optimized by replacing the class 
__dict__ with specific descriptors. This results in a class where only specific 
attributes can be get/set.

However, you only really get the savings from __slots__ if all base classes 
also implement it.

An example:

from pympler.asizeof import asizeof  # checks complete size of objects in 
memory

class EmptyNoSlots: pass

class EmptyWithSlots: __slots__ = ()

class NoSlots:
def __init__(self, a, b): self.a, self.b = a, b

class WithSlots:
__slots__ = ("a", "b")
def __init__(self, a, b): self.a, self.b = a, b

print(asizeof(EmptyNoSlots()))# 152
print(asizeof(EmptyWithSlots()))  # 32
print(asizeof(NoSlots(1, 2))) # 328
print(asizeof(WithSlots(1, 2)))   # 112

# Let's look at inheritance:

class WithSlotsAndProperBaseClass(EmptyWithSlots):
__slots__ = ("a", "b")
def __init__(self, a, b): self.a, self.b = a, b

class NoSlotsAtAll(EmptyNoSlots):
def __init__(self, a, b): self.a, self.b = a, b

class WithSlotsAndBadBaseClass(EmptyNoSlots):
__slots__ = ("a", "b")
def __init__(self, a, b): self.a, self.b = a, b

print(asizeof(WithSlotsAndProperBaseClass(1, 2)))  # 112
print(asizeof(NoSlotsAtAll(1, 2))) # 328
print(asizeof(WithSlotsAndBadBaseClass(1, 2))) # 232 -- oh no!

In importlib:

   list   <- has slots (builtin)
   DeprecatedList(list)   <- no __slots__ defined
EntryPoints(DeprecatedList)   <- defines __slots__

Besides the lost memory savings, because `DeprecatedList` has no slots, you can 
still do:

EntryPoints().foo = 6  # setting a random attribute, not the intention.

Further reading: https://stackoverflow.com/a/28059785

--

___
Python tracker 

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



[issue46235] Do all ref-counting at once for sequence multiplication

2022-01-03 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Benchmarks are definitively better with the most recent change (in which the 
major data-copying loop is between parts of the same buffer):

-- MSVC 

Slower (3):
- (None,) * 2: 54.0 ns +- 0.7 ns -> 63.4 ns +- 2.5 ns: 1.17x slower
- [None] * 2: 61.6 ns +- 3.3 ns -> 69.0 ns +- 1.4 ns: 1.12x slower
- [None] * 10: 72.3 ns +- 2.2 ns -> 73.9 ns +- 2.3 ns: 1.02x slower

Faster (33):
- [None] * 1: 25.1 us +- 0.2 us -> 12.8 us +- 0.2 us: 1.96x faster
- (None,) * 1: 26.7 us +- 0.2 us -> 15.2 us +- 0.2 us: 1.76x faster
- list(range(1000)) * 100: 248 us +- 95 us -> 146 us +- 50 us: 1.70x faster
- list(range(1000)) * 10: 16.8 us +- 0.2 us -> 10.4 us +- 0.1 us: 1.61x faster
- list(range(100)) * 100: 13.8 us +- 0.3 us -> 8.60 us +- 0.09 us: 1.60x faster
- list(range(10)) * 100: 1.41 us +- 0.02 us -> 924 ns +- 15 ns: 1.53x faster
- list(range(100)) * 10: 1.47 us +- 0.10 us -> 981 ns +- 14 ns: 1.50x faster
- tuple(range(10)) * 1: 255 us +- 91 us -> 171 us +- 51 us: 1.49x faster
- [None] * 100: 355 ns +- 11 ns -> 245 ns +- 7 ns: 1.45x faster
- (None,) * 100: 357 ns +- 4 ns -> 261 ns +- 3 ns: 1.37x faster
- tuple(range(1000)) * 10: 17.8 us +- 0.3 us -> 13.3 us +- 0.1 us: 1.34x faster
- list(range(10)) * 1: 205 us +- 49 us -> 157 us +- 95 us: 1.31x faster
- list(range(1000)) * 2: 3.32 us +- 0.07 us -> 2.63 us +- 0.03 us: 1.26x faster
- tuple(range(100)) * 100: 15.9 us +- 0.2 us -> 13.0 us +- 0.1 us: 1.22x faster
- list(range(1000)) * 1: 33.9 ms +- 0.9 ms -> 28.2 ms +- 1.6 ms: 1.20x 
faster
- ["Python", "Perl"] * 1: 31.4 us +- 4.3 us -> 26.2 us +- 0.7 us: 1.20x 
faster
- tuple(range(1000)) * 1: 33.8 ms +- 0.8 ms -> 28.3 ms +- 1.3 ms: 1.19x 
faster
- tuple(range(100)) * 10: 1.68 us +- 0.02 us -> 1.42 us +- 0.01 us: 1.18x faster
- ["Python", "Perl"] * 100: 442 ns +- 67 ns -> 376 ns +- 6 ns: 1.18x faster
- tuple(range(10)) * 100: 1.63 us +- 0.02 us -> 1.40 us +- 0.02 us: 1.17x faster
- tuple(range(1000)) * 2: 3.61 us +- 0.06 us -> 3.11 us +- 0.06 us: 1.16x faster
- list(range(10)) * 10: 238 ns +- 8 ns -> 206 ns +- 6 ns: 1.16x faster
- list(range(100)) * 1: 3.15 ms +- 0.13 ms -> 2.73 ms +- 0.15 ms: 1.15x 
faster
- list(range(100)) * 2: 370 ns +- 12 ns -> 323 ns +- 6 ns: 1.14x faster
- tuple(range(100)) * 1: 3.24 ms +- 0.13 ms -> 2.85 ms +- 0.13 ms: 1.14x 
faster
- ("Python", "Perl") * 1: 31.1 us +- 0.3 us -> 27.4 us +- 0.3 us: 1.14x 
faster
- ("Python", "Perl") * 100: 438 ns +- 7 ns -> 389 ns +- 9 ns: 1.13x faster
- ["Python", "Perl"] * 10: 86.1 ns +- 4.2 ns -> 77.3 ns +- 2.4 ns: 1.11x faster
- list(range(10)) * 2: 81.5 ns +- 2.8 ns -> 77.0 ns +- 2.1 ns: 1.06x faster
- ("Python", "Perl") * 10: 92.6 ns +- 7.8 ns -> 88.4 ns +- 4.8 ns: 1.05x faster
- ["Python", "Perl"] * 2: 63.9 ns +- 2.6 ns -> 61.3 ns +- 1.7 ns: 1.04x faster
- tuple(range(100)) * 2: 414 ns +- 19 ns -> 404 ns +- 6 ns: 1.02x faster
- tuple(range(10)) * 10: 258 ns +- 7 ns -> 253 ns +- 8 ns: 1.02x faster

Benchmark hidden because not significant (4): ("Python", "Perl") * 2, 
tuple(range(10)) * 2, (None,) * 10, tuple(range(1000)) * 100

Geometric mean: 1.21x faster


 GCC PGO on WSL 

Slower (4):
- [None] * 10: 58.1 ns +- 0.7 ns -> 59.4 ns +- 0.9 ns: 1.02x slower
- ("Python", "Perl") * 2: 48.9 ns +- 0.6 ns -> 49.9 ns +- 0.6 ns: 1.02x slower
- [None] * 1000: 1.56 us +- 0.02 us -> 1.59 us +- 0.02 us: 1.02x slower
- [None] * 2: 51.9 ns +- 0.5 ns -> 52.4 ns +- 0.8 ns: 1.01x slower

Faster (44):
- list(range(100)) * 1: 1.98 ms +- 0.33 ms -> 976 us +- 43 us: 2.03x faster
- list(range(1000)) * 100: 168 us +- 2 us -> 84.8 us +- 1.0 us: 1.98x faster
- list(range(1000)) * 10: 15.9 us +- 0.2 us -> 8.47 us +- 0.20 us: 1.88x faster
- list(range(100)) * 100: 13.1 us +- 0.2 us -> 7.02 us +- 0.12 us: 1.87x faster
- list(range(1000)) * 1000: 1.80 ms +- 0.05 ms -> 986 us +- 12 us: 1.83x faster
- list(range(100)) * 1000: 140 us +- 2 us -> 79.1 us +- 0.9 us: 1.77x faster
- list(range(10)) * 1: 136 us +- 2 us -> 77.5 us +- 1.0 us: 1.76x faster
- list(range(1000)) * 1: 26.0 ms +- 0.6 ms -> 15.2 ms +- 0.3 ms: 1.71x 
faster
- list(range(10)) * 1000: 12.2 us +- 0.2 us -> 7.18 us +- 0.08 us: 1.70x faster
- tuple(range(1000)) * 100: 167 us +- 2 us -> 106 us +- 1 us: 1.58x faster
- tuple(range(1000)) * 1000: 1.78 ms +- 0.03 ms -> 1.13 ms +- 0.01 ms: 1.58x 
faster
- tuple(range(10)) * 1: 148 us +- 7 us -> 95.5 us +- 1.1 us: 1.55x faster
- list(range(10)) * 100: 1.19 us +- 0.10 us -> 795 ns +- 20 ns: 1.49x faster
- tuple(range(1000)) * 10: 15.9 us +- 0.4 us -> 10.6 us +- 0.2 us: 1.49x faster
- list(range(100)) * 10: 1.17 us +- 0.03 us -> 797 ns +- 17 ns: 1.47x faster
- (None,) * 1: 27.5 us +- 0.3 us -> 18.9 us +- 0.1 us: 1.46x faster
- tuple(range(100)) * 1000: 138 us +- 2 us -> 95.4 us +- 0.7 us: 1.45x faster
- tuple(range(100)) * 1: 1.52 ms +- 0.02 ms -> 1.05 ms +- 0.01 ms: 1.45x 
faster
- tuple(range(10)) * 1000: 12.9 us +- 0.2 us -> 9.28 us +- 0.18 us: 1.3

[issue46245] Add support for dir_fd in shutil.rmtree()

2022-01-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I am sorry, I implemented this feature before opening this issue, but due to 
typo the PR was not linked here.

--

___
Python tracker 

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



[issue46245] Add support for dir_fd in shutil.rmtree()

2022-01-03 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +28596
pull_request: https://github.com/python/cpython/pull/30365

___
Python tracker 

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



[issue46253] C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4

2022-01-03 Thread Julian Gilbey


Change by Julian Gilbey :


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

___
Python tracker 

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



[issue46253] C API documentation of Py_UNICODE_* character properties macros use Py_UNICODE instead of Py_UCS4

2022-01-03 Thread Julian Gilbey


New submission from Julian Gilbey :

The documentation at 
https://docs.python.org/3/c-api/unicode.html?highlight=isalpha#unicode-character-properties
 lists a series of macros such as Py_UNICODE_ISSPACE(Py_UNICODE ch).  However, 
the input type for these macros was changed from Py_UNICODE to Py_UCS4 in 
commit 324ac65cebf4b0141b946452a2604715f1ca7010 on Wed Aug 18 20:44:58 2010 
+, but it seems that the documentation has never been updated.  The fix 
should be easy; I'll make a PR for it.

--
assignee: docs@python
components: Documentation
messages: 409649
nosy: docs@python, juliangilbey
priority: normal
severity: normal
status: open
title: C API documentation of Py_UNICODE_* character properties macros use 
Py_UNICODE instead of Py_UCS4
versions: Python 3.10, Python 3.11, 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



[issue46245] Add support for dir_fd in shutil.rmtree()

2022-01-03 Thread Yassir Karroum


Change by Yassir Karroum :


--
keywords: +patch
nosy: +ukarroum
nosy_count: 1.0 -> 2.0
pull_requests: +28594
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30386

___
Python tracker 

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



[issue46252] SSLWantReadError causes _SelectorSocketTransport to close

2022-01-03 Thread Matan Perelman


Change by Matan Perelman :


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

___
Python tracker 

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



[issue46252] SSLWantReadError causes _SelectorSocketTransport to close

2022-01-03 Thread Matan Perelman


Change by Matan Perelman :


--
assignee: christian.heimes
components: SSL, asyncio
nosy: asvetlov, christian.heimes, matan1008, yselivanov
priority: normal
severity: normal
status: open
title: SSLWantReadError causes _SelectorSocketTransport to close
type: behavior
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue46235] Do all ref-counting at once for sequence multiplication

2022-01-03 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Hm... the effects are completely different on GCC. This is with 
--enable-optimizations and GCC on WSL:

Slower (29):
- tuple(range(100)) * 10: 1.22 us +- 0.02 us -> 2.29 us +- 0.05 us: 1.87x slower
- tuple(range(100)) * 2: 345 ns +- 7 ns -> 629 ns +- 5 ns: 1.82x slower
- tuple(range(1000)) * 2: 3.03 us +- 0.06 us -> 5.32 us +- 0.05 us: 1.76x slower
- tuple(range(10)) * 100: 1.25 us +- 0.08 us -> 2.18 us +- 0.03 us: 1.74x slower
- tuple(range(10)) * 1000: 12.9 us +- 0.2 us -> 20.8 us +- 0.2 us: 1.61x slower
- tuple(range(100)) * 100: 13.0 us +- 0.2 us -> 20.9 us +- 0.1 us: 1.60x slower
- tuple(range(100)) * 1000: 138 us +- 2 us -> 211 us +- 2 us: 1.52x slower
- ("Python", "Perl") * 1000: 3.18 us +- 0.03 us -> 4.69 us +- 0.03 us: 1.47x 
slower
- tuple(range(100)) * 1: 1.52 ms +- 0.02 ms -> 2.21 ms +- 0.02 ms: 1.45x 
slower
- tuple(range(10)) * 1: 148 us +- 7 us -> 211 us +- 2 us: 1.43x slower
- tuple(range(1000)) * 10: 15.9 us +- 0.4 us -> 22.3 us +- 0.2 us: 1.40x slower
- ("Python", "Perl") * 1: 33.8 us +- 0.8 us -> 46.5 us +- 0.6 us: 1.38x 
slower
- ("Python", "Perl") * 100: 428 ns +- 9 ns -> 577 ns +- 6 ns: 1.35x slower
- tuple(range(1000)) * 100: 167 us +- 2 us -> 218 us +- 2 us: 1.30x slower
- tuple(range(10)) * 2: 85.5 ns +- 3.9 ns -> 111 ns +- 3 ns: 1.30x slower
- (None,) * 100: 306 ns +- 4 ns -> 396 ns +- 3 ns: 1.29x slower
- tuple(range(1000)) * 1000: 1.78 ms +- 0.03 ms -> 2.27 ms +- 0.02 ms: 1.27x 
slower
- (None,) * 1000: 2.66 us +- 0.02 us -> 3.25 us +- 0.03 us: 1.22x slower
- tuple(range(10)) * 10: 236 ns +- 17 ns -> 287 ns +- 2 ns: 1.22x slower
- tuple(range(1000)) * 1: 23.2 ms +- 0.4 ms -> 28.1 ms +- 0.3 ms: 1.21x 
slower
- ("Python", "Perl") * 10: 88.6 ns +- 2.7 ns -> 106 ns +- 3 ns: 1.19x slower
- (None,) * 1: 27.5 us +- 0.3 us -> 31.5 us +- 0.2 us: 1.14x slower
- ("Python", "Perl") * 2: 48.9 ns +- 0.6 ns -> 54.7 ns +- 0.8 ns: 1.12x slower
- (None,) * 10: 63.4 ns +- 1.7 ns -> 70.0 ns +- 0.6 ns: 1.10x slower
- (None,) * 2: 46.7 ns +- 0.5 ns -> 49.8 ns +- 0.5 ns: 1.06x slower
- list(range(10)) * 2: 73.5 ns +- 1.2 ns -> 76.6 ns +- 2.3 ns: 1.04x slower
- [None] * 10: 58.1 ns +- 0.7 ns -> 60.3 ns +- 0.7 ns: 1.04x slower
- ["Python", "Perl"] * 2: 56.1 ns +- 0.6 ns -> 57.4 ns +- 0.9 ns: 1.02x slower
- [None] * 2: 51.9 ns +- 0.5 ns -> 52.3 ns +- 0.5 ns: 1.01x slower

Faster (18):
- list(range(100)) * 1: 1.98 ms +- 0.33 ms -> 953 us +- 14 us: 2.08x faster
- list(range(1000)) * 100: 168 us +- 2 us -> 86.8 us +- 0.9 us: 1.93x faster
- list(range(1000)) * 10: 15.9 us +- 0.2 us -> 8.40 us +- 0.13 us: 1.89x faster
- list(range(100)) * 100: 13.1 us +- 0.2 us -> 7.41 us +- 0.09 us: 1.77x faster
- list(range(1000)) * 1000: 1.80 ms +- 0.05 ms -> 1.04 ms +- 0.04 ms: 1.73x 
faster
- list(range(100)) * 1000: 140 us +- 2 us -> 82.2 us +- 4.9 us: 1.70x faster
- list(range(1000)) * 1: 26.0 ms +- 0.6 ms -> 15.4 ms +- 0.3 ms: 1.69x 
faster
- ["Python", "Perl"] * 1: 33.8 us +- 0.3 us -> 21.2 us +- 0.2 us: 1.59x 
faster
- ["Python", "Perl"] * 1000: 3.41 us +- 0.03 us -> 2.17 us +- 0.02 us: 1.57x 
faster
- list(range(10)) * 1000: 12.2 us +- 0.2 us -> 8.11 us +- 0.21 us: 1.51x faster
- list(range(10)) * 1: 136 us +- 2 us -> 91.7 us +- 1.0 us: 1.49x faster
- list(range(10)) * 100: 1.19 us +- 0.10 us -> 806 ns +- 15 ns: 1.47x faster
- list(range(1000)) * 2: 3.05 us +- 0.07 us -> 2.08 us +- 0.04 us: 1.46x faster
- list(range(100)) * 10: 1.17 us +- 0.03 us -> 850 ns +- 16 ns: 1.38x faster
- ["Python", "Perl"] * 100: 440 ns +- 8 ns -> 325 ns +- 5 ns: 1.35x faster
- list(range(10)) * 10: 172 ns +- 2 ns -> 148 ns +- 2 ns: 1.16x faster
- list(range(100)) * 2: 320 ns +- 19 ns -> 289 ns +- 3 ns: 1.11x faster
- ["Python", "Perl"] * 10: 85.0 ns +- 3.1 ns -> 79.7 ns +- 2.4 ns: 1.07x faster

Benchmark hidden because not significant (3): [None] * 100, [None] * 1000, 
[None] * 1

Geometric mean: 1.01x slower

--

___
Python tracker 

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



[issue44875] Update dis.findlinestarts documentaiton to reflect new usage of `co_lines` (PEP 626)

2022-01-03 Thread laike9m


laike9m  added the comment:

Agreed. The current doc for `findlinestarts` is outdated.

--
nosy: +laike9m

___
Python tracker 

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



[issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+

2022-01-03 Thread neonene


neonene  added the comment:

>Here's a branch with a passing ntpath.normpath test and a failing 
>posixpath.normpath test:

I took the test cases for my PR, thanks.
On Windows machine, ntpath fails and posixpath passes. It seems that the 
passing one is tested with pure python code.

--

___
Python tracker 

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



[issue46233] Minor speedup for bigint squaring

2022-01-03 Thread Tim Peters


Change by Tim Peters :


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



[issue46233] Minor speedup for bigint squaring

2022-01-03 Thread Tim Peters


Tim Peters  added the comment:


New changeset 3aa5242b54b0627293d95cfb4a26b2f917f667be by Tim Peters in branch 
'main':
bpo-46233: Minor speedup for bigint squaring (GH-30345)
https://github.com/python/cpython/commit/3aa5242b54b0627293d95cfb4a26b2f917f667be


--

___
Python tracker 

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



[issue41011] [venv] record which executable and command were used to create a virtual environment

2022-01-03 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 2.0 -> 3.0
pull_requests: +28592
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30382

___
Python tracker 

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



[issue44092] [sqlite3] Remove special rollback handling

2022-01-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +28591
pull_request: https://github.com/python/cpython/pull/30381

___
Python tracker 

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



[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-01-03 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

Perhaps it is a mistake. The `__slots__` were added as a (possible premature) 
optimization in [this 
conversation](https://github.com/python/importlib_metadata/pull/278/files#r565475347).

It's not obvious to me what the danger is in defining __slots__ in a child 
class but not in a parent. Can you point me to resources or examples that help 
me understand the concern or missed expectation? The primary motivation behind 
defining slots is to help ensure immutability.  Does the lack of slots violate 
that expectation?

Convince me of the value of fixing this concern and please feel free to proceed 
with a PR.

--

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop

2022-01-03 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> So, another option would be to keep "set-lastrowid" in the query loop, and
> just remove the condition; we set it every time (but of course only build a
> PyObject of it when the loop is done).

I made a competing PR (GH-30380) for this, just a little better (IMO); the Py 
object is only built on demand :)

--

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop

2022-01-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +28590
pull_request: https://github.com/python/cpython/pull/30380

___
Python tracker 

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



[issue44092] [sqlite3] Remove special rollback handling

2022-01-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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



[issue46249] [sqlite3] move set lastrowid out of the query loop

2022-01-03 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

I see that PEP 249 does not define the semantics of lastrowid for 
executemany(). What's the precedence here, MAL? IMO, it would be nice to be 
able to fetch the last row id after you've done a 1000 inserts using 
executemany().

So, another option would be to keep "set-lastrowid" in the query loop, and just 
remove the condition; we set it every time (but of course only build a PyObject 
of it when the loop is done).

--
nosy: +lemburg

___
Python tracker 

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



[issue42259] pprint: infinite recursion for saferepr() when using nested objects, but str() works

2022-01-03 Thread Irit Katriel


Irit Katriel  added the comment:

The documentation change in the PR clarifies the current state of things. 

@serhiy.storchaka - do you have a view on whether we should aim for an actual 
fix, or just document and close?

--

___
Python tracker 

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



[issue44092] [sqlite3] Remove special rollback handling

2022-01-03 Thread miss-islington


miss-islington  added the comment:


New changeset f1a58441eea6b7788c64d03a80ea35996301e550 by Erlend Egeberg 
Aasland in branch 'main':
bpo-44092: Remove unused member `reset` from `sqlite3.Cursor` (GH-30377)
https://github.com/python/cpython/commit/f1a58441eea6b7788c64d03a80ea35996301e550


--
nosy: +miss-islington

___
Python tracker 

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



[issue44958] [sqlite3] only reset statements when needed

2022-01-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +28589
pull_request: https://github.com/python/cpython/pull/30379

___
Python tracker 

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



[issue46240] Incorrect hint about forgetting a comma

2022-01-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I presume you mean
> "it is very very *likely* that there is no actual regression"

Yes, sorry, that's what I meant :)

> This shouldn't hold up releases

Cool, we will proceed with 3.9.10 and 3.11.0a3 tomorrow.

--

___
Python tracker 

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Library (Lib)

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Library (Lib)
resolution: fixed -> 

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

"is very very unlike that there is no actual regression"

I presume you meant

"it is very very *likely* that there is no actual regression"

This shouldn't hold up releases, but (having spent months trying to improve 
startup speed) I would still like to get to the bottom of the speed.python.org 
regression.

--
priority: release blocker -> normal

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread Irit Katriel


Change by Irit Katriel :


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



[issue44092] [sqlite3] Remove special rollback handling

2022-01-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington


miss-islington  added the comment:


New changeset 4affb996ce6353dd029ece0c7d36f7c7c0af2de3 by Miss Islington (bot) 
in branch '3.9':
bpo-34538: Remove Exception subclassing from tutorial (GH-30361)
https://github.com/python/cpython/commit/4affb996ce6353dd029ece0c7d36f7c7c0af2de3


--

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington


miss-islington  added the comment:


New changeset 0b3c3cbbaf2967cc17531d65ece0969b0d2a2079 by Miss Islington (bot) 
in branch '3.10':
bpo-34538: Remove Exception subclassing from tutorial (GH-30361)
https://github.com/python/cpython/commit/0b3c3cbbaf2967cc17531d65ece0969b0d2a2079


--

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

At thing at this point we can confidently say that is very very unlike that 
there is no actual regression.

What's going on with the performance servers is something I still cannot 
explain. I at least can confirm the servers system packages were not updated 
between these runs but I cannot think of anything that could have influenced 
that change.

I propose to close this issue as we are clearly unable to reproduce said 
slowdown.

--

___
Python tracker 

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



[issue46187] Optionally support rounding for math.isqrt()

2022-01-03 Thread Tim Peters


Tim Peters  added the comment:

I've made several good-faith efforts to find any hint of demand for rounded 
isqrt on the web; I've found no direct support for it in other 
languages/environments(*); and the one use case you presented isn't compelling. 
Building static tables to help implement extended precision functions via 
scaled integer arithmetic is quite niche, and anyone numerically knowledgeable 
enough to pull that off will have no trouble figuring out how to roll their own 
isqrt rounding. For them, isqrtrem would make it dead easy.

Close to no demonstrated demand, and no demonstrated prior art, coupled with 
slowing down _every_ isqrt() call to cater to an overwhelmingly unused 
possibility (and, to boot, via the slowest possible way of specifying an 
option, on what should be a fast function), leaves me -1. No, I'm not a fan of 
the "big"/"little" mandatory arguments to int.{from,to}_bytes() either.

+0 on isqrtrem, though, because it follows established practice in a related 
context (mpz), and also offers efficient support for the related use case I 
actually found some (albeit small) demand for ("and was it a perfect square?").

(*) Other languages with an integer square root include Common Lisp, Julia, and 
Maple's programming language. None have an option for rounding. Maple's doesn't 
define the rounding used, other than to promise the result is less than 1 away 
from the infinitely precise result. Common Lisp and Julia return the floor. A 
number of environments essentially inherit isqrt from their Lisp base (e.g., 
wxMaxima).

--

___
Python tracker 

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



[issue44092] [sqlite3] Remove special rollback handling

2022-01-03 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Reopening; there's some clean-up left.

After GH-26026, the `reset` member of `pysqlite_Cursor` is now unused. We can 
remove it and all related code. PR coming.

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread MarkBaggett


MarkBaggett  added the comment:

"Dont load untrusted config files" is the answer I expected. It the only safe 
answer really. But is there really a mechanism to provide trust of an external 
config file other that file permissions? It doesn't seem like hmac or digital 
signatures work because you have to provide a mechanism to resign it every time 
they change a config. So an attacker could just resign after adding the 
exploit. Maybe file permissions is all we have. 

Is it reasonable to say that all classes  by _resolve() and resolve() should 
have "logger." at the top of them? If not perhaps the object could have a 
permitted list of top level packages that defaults to just "logger." but could 
be extended to others by the developer.

--

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Łukasz Langa

Łukasz Langa  added the comment:

(that's on M1 Macbook Pro on macOS Monterey)

--

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Łukasz Langa

Łukasz Langa  added the comment:

I ran all benchmarks on installed optimized framework builds of 3.9 with the 
change (-a) and with the revert (-revert). It shows no change:

❯ ./python3.9 -m pyperf compare_to /Volumes/RAMDisk/py39*
2to3: Mean +- std dev: [py39-a] 724 ms +- 6 ms -> [py39-revert] 722 ms +- 2 ms: 
1.00x faster
fannkuch: Mean +- std dev: [py39-a] 1.26 sec +- 0.00 sec -> [py39-revert] 1.26 
sec +- 0.00 sec: 1.00x faster
float: Mean +- std dev: [py39-a] 320 ms +- 3 ms -> [py39-revert] 319 ms +- 1 
ms: 1.00x faster
go: Mean +- std dev: [py39-a] 726 ms +- 6 ms -> [py39-revert] 718 ms +- 4 ms: 
1.01x faster
hexiom: Mean +- std dev: [py39-a] 28.3 ms +- 0.3 ms -> [py39-revert] 28.1 ms +- 
0.3 ms: 1.00x faster
logging_format: Mean +- std dev: [py39-a] 22.5 us +- 0.3 us -> [py39-revert] 
22.4 us +- 0.2 us: 1.00x faster
nqueens: Mean +- std dev: [py39-a] 274 ms +- 2 ms -> [py39-revert] 273 ms +- 2 
ms: 1.00x faster
pickle_dict: Mean +- std dev: [py39-a] 57.4 us +- 0.6 us -> [py39-revert] 57.1 
us +- 0.7 us: 1.01x faster
pickle_pure_python: Mean +- std dev: [py39-a] 1.32 ms +- 0.02 ms -> 
[py39-revert] 1.31 ms +- 0.02 ms: 1.01x faster
pidigits: Mean +- std dev: [py39-a] 619 ms +- 0 ms -> [py39-revert] 614 ms +- 0 
ms: 1.01x faster
pyflate: Mean +- std dev: [py39-a] 2.02 sec +- 0.02 sec -> [py39-revert] 2.00 
sec +- 0.01 sec: 1.01x faster
python_startup: Mean +- std dev: [py39-a] 26.3 ms +- 0.1 ms -> [py39-revert] 
26.3 ms +- 0.1 ms: 1.00x slower
regex_dna: Mean +- std dev: [py39-a] 255 ms +- 2 ms -> [py39-revert] 250 ms +- 
1 ms: 1.02x faster
regex_effbot: Mean +- std dev: [py39-a] 6.23 ms +- 0.04 ms -> [py39-revert] 
6.18 ms +- 0.01 ms: 1.01x faster
regex_v8: Mean +- std dev: [py39-a] 43.5 ms +- 0.4 ms -> [py39-revert] 43.3 ms 
+- 0.1 ms: 1.01x faster
richards: Mean +- std dev: [py39-a] 228 ms +- 3 ms -> [py39-revert] 226 ms +- 3 
ms: 1.01x faster
spectral_norm: Mean +- std dev: [py39-a] 430 ms +- 4 ms -> [py39-revert] 429 ms 
+- 3 ms: 1.00x faster
sympy_expand: Mean +- std dev: [py39-a] 1.25 sec +- 0.01 sec -> [py39-revert] 
1.25 sec +- 0.01 sec: 1.00x slower
sympy_str: Mean +- std dev: [py39-a] 733 ms +- 7 ms -> [py39-revert] 729 ms +- 
6 ms: 1.01x faster
telco: Mean +- std dev: [py39-a] 16.6 ms +- 0.2 ms -> [py39-revert] 16.5 ms +- 
0.1 ms: 1.01x faster
unpack_sequence: Mean +- std dev: [py39-a] 238 ns +- 3 ns -> [py39-revert] 236 
ns +- 2 ns: 1.01x faster
unpickle: Mean +- std dev: [py39-a] 41.3 us +- 0.5 us -> [py39-revert] 41.1 us 
+- 0.5 us: 1.01x faster
unpickle_list: Mean +- std dev: [py39-a] 12.5 us +- 0.1 us -> [py39-revert] 
12.5 us +- 0.1 us: 1.01x slower

Benchmark hidden because not significant (35): chameleon, chaos, crypto_pyaes, 
deltablue, django_template, dulwich_log, json_dumps, json_loads, 
logging_silent, logging_simple, mako, meteor_contest, nbody, pathlib, pickle, 
pickle_list, python_startup_no_site, raytrace, regex_compile, scimark_fft, 
scimark_lu, scimark_monte_carlo, scimark_sor, scimark_sparse_mat_mult, 
sqlalchemy_declarative, sqlalchemy_imperative, sqlite_synth, sympy_integrate, 
sympy_sum, tornado_http, unpickle_pure_python, xml_etree_parse, 
xml_etree_iterparse, xml_etree_generate, xml_etree_process

Geometric mean: 1.00x faster

--

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28585
pull_request: https://github.com/python/cpython/pull/30374

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington


miss-islington  added the comment:


New changeset 2db56130631255ca2eb504519430fb2f1fe789e9 by Hugo van Kemenade in 
branch 'main':
bpo-34538: Remove Exception subclassing from tutorial (GH-30361)
https://github.com/python/cpython/commit/2db56130631255ca2eb504519430fb2f1fe789e9


--
nosy: +miss-islington

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28586
pull_request: https://github.com/python/cpython/pull/30375

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread Irit Katriel


Change by Irit Katriel :


--
versions: +Python 3.11 -Python 3.8

___
Python tracker 

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

Actually, the last line isn't necessary.


import logging.config
import json

log_config_txt = '''{
"version":1,
"formatters":{
"EXPLOIT":{
"class": "os.popen",
"format": "touch itworked",
"datefmt": "r",
"style": 1
}
}
}
'''

log_config = json.loads(log_config_txt)
logging.config.dictConfig(log_config)


I suspect the answer to this will be: "don't load untrusted configuration 
files". But I'll see what others have to say. There should probably be a 
warning about it somewhere. I didn't see anything.

--

___
Python tracker 

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks.

Here's a somewhat smaller, one-file version, that writes to the current 
directory (I'm on Windows, no /tmp):

-
import logging
import logging.config
import json

log_config_txt = '''{
"version":1,
"formatters":{
"EXPLOIT":{
"class": "os.popen",
"format": "touch itworked",
"datefmt": "r",
"style": 1

}
}
}
'''

log_config = json.loads(log_config_txt)
logging.config.dictConfig(log_config)
logger = logging.getLogger("calculator")
-

--

___
Python tracker 

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread MarkBaggett


MarkBaggett  added the comment:

Here are the relevant parts of calculator.py..

import logging
import logging.config
import json
import pathlib
import os

config_location = pathlib.Path(  os.path.realpath(__file__) ).parent / 
"log.config"
log_config = json.load( config_location.open() )

logging.config.dictConfig(log_config)

logger = logging.getLogger("calculator")

--

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2022-01-03 Thread Jan Novak


Jan Novak  added the comment:

It is interesting that pathlib.Path works fine:

>>> pathlib.Path('jpg').suffix
'.jpg'
>>> pathlib.Path('path/jpg').suffix
'.jpg'

--

___
Python tracker 

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

What are the contents of calculator.py?

--
nosy: +eric.smith

___
Python tracker 

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-03 Thread MarkBaggett


New submission from MarkBaggett :

I know there are multiple warnings about the use of eval() in the listener. But 
_resolve() and resolve() used by both fileConfig and dictConfig also seem like 
they can also be abused. Here is a working example.

$ ls /tmp/itworked 
ls: cannot access '/tmp/itworked': No such file or directory
$ cat log.config 
{
"version":1,
"formatters":{
"EXPLOIT":{
"class": "os.popen",
"format": "touch /tmp/itworked",
"datefmt": "r",
"style": 1

}
}
}

$ python calculator.py 
/usr/lib/python3.8/subprocess.py:848: RuntimeWarning: line buffering 
(buffering=1) isn't supported in binary mode, the default buffer size will be 
used
  self.stdout = io.open(c2pread, 'rb', bufsize)
WARNING:calculator.support_functions:Internet Confirmed.
WARNING:calculator.support_functions:Adder object exported!
WARNING:calculator.support_functions.adder:Set initial value to 0
WARNING:calculator:The result is 15
$ ls /tmp/itworked 
/tmp/itworked

I could probably clean up that error message if I took 2 minute to refresh my 
os.popen knowledge, but I think you get the point. Are you aware of this issue?

Thanks for all you to on this import module!

--
messages: 409623
nosy: MarkBaggett
priority: normal
severity: normal
status: open
title: logger.config.configure_formatter executes arbitrary code
type: security
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



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

2022-01-03 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher
nosy_count: 10.0 -> 11.0
pull_requests: +28584
pull_request: https://github.com/python/cpython/pull/30372

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2022-01-03 Thread Jan Novak


Jan Novak  added the comment:

Thank you all for discussion and partial solution in latest Python versions and 
extending documentation.

For the future development of Python the initial question remains.
How to easy detect extensions for each file with standard python library 
function. Without programing own function to fix it.

Filenames with more dots could exist both in Unix and Windows worlds.
Nobody can't say (for example web app users). Please not use those files.

Python 3.10.1
Works fine:
>>> os.path.splitext('.some.jpg')
('.some', '.jpg')
>>> os.path.splitext('..some.jpg')
('..some', '.jpg')

Not usable:
>>> os.path.splitext('jpg')
('jpg', '')

There are some possible ways:
- new parametr
- new function
- change backward compatibility
- stay buggy forever

Thank you

--
status: closed -> open
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



[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-01-03 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +jaraco

___
Python tracker 

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



[issue46250] 3.10 docs responsive design removes navigation buttons (next, previous ...) on narrow screens for no reason

2022-01-03 Thread VanjaVK


New submission from VanjaVK :

This kind of responsive design makes it hard to navigate to next or previous 
section easily. I don't see any UX gain having a fullscreen wide search with a 
hamburger-style menu. I also believe this is very unfriendly towards disabled 
people.

Better explained in the picture provided: https://i.imgur.com/nYdSM5H.png

--
assignee: docs@python
components: Documentation
files: pythondocs.png
messages: 409621
nosy: docs@python, vkvanjavk
priority: normal
severity: normal
status: open
title: 3.10 docs responsive design removes navigation buttons (next, previous 
...) on narrow screens for no reason
type: enhancement
versions: Python 3.10
Added file: https://bugs.python.org/file50539/pythondocs.png

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop

2022-01-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue46249] [sqlite3] move set lastrowid out of the query loop

2022-01-03 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

The query loop in _pysqlite_query_execute() is run only once for ordinary 
execute()'s, but multiple times for executemany(). We use the 'multiple' 
variable to differ between the two execute methods; for execute(), multiple is 
false, for executemany(), multiple is true. At the end of the loop, the 
'lastrowid' connection attribute is set, if multiple is false. We can safely 
move this part out of the loop; it is irrelevant for executemany(), and it will 
only be run once for execute().

--
assignee: erlendaasland
components: Extension Modules
messages: 409620
nosy: erlendaasland
priority: normal
severity: normal
status: open
title: [sqlite3] move set lastrowid out of the query loop
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue46033] Duplicated sentence in for statement documentation

2022-01-03 Thread Vedran Čačić

Vedran Čačić  added the comment:

Yes, it's ok. The only slight problem is that is suggests that first item is 
somehow special, but later it is explained that in fact it is not. :-) I would 
say "_Each_ item ..." (instead of "First") and without the "this is repeated 
for every item..." at the end, but as I said, this is also fine.

--

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel


Change by Irit Katriel :


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



[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 4a792ca95c1a994b07d18fe06e2104d5b1e0b796 by Miss Islington (bot) 
in branch '3.9':
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple 
leading periods (GH-30347) (GH-30369)
https://github.com/python/cpython/commit/4a792ca95c1a994b07d18fe06e2104d5b1e0b796


--

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 8184a613b93d54416b954e667951cdf3d069cc13 by Miss Islington (bot) 
in branch '3.10':
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple 
leading periods (GH-30347) (GH-30368)
https://github.com/python/cpython/commit/8184a613b93d54416b954e667951cdf3d069cc13


--

___
Python tracker 

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



[issue46248] Compilation errors on macOS

2022-01-03 Thread Ned Deily


Ned Deily  added the comment:

Thanks for the report. Without more details, we can only guess at what you are 
trying to accomplish. I would assume it involves embedding Python in another 
library or application. If so, you should not be using LINKFORSHARED at all 
which is used to build Python itself (see, for example, Issue36508). Moreover, 
when embedding on macOS, we do not recommend trying to use the -framework 
argument to compile with or link to Python: it's too easy to get wrong. 
Instead, as shown in the use the "Extending and Embedding the Python 
Interpreter" section of the docset, use the output from the appropriate 
python3.x-config command, for example:

$ python3.10-config --cflags
-I/Library/Frameworks/Python.framework/Versions/3.10.1_11/include/python3.10 
-I/Library/Frameworks/Python.framework/Versions/3.10.1_11/include/python3.10 
-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic 
-DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g

$ python3.10-config --ldflags
-L/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/config-3.10-darwin
 -ldl -framework CoreFoundation

https://docs.python.org/3/extending/embedding.html#compiling-and-linking-under-unix-like-systems

--

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2022-01-03 Thread miss-islington


Change by miss-islington :


--
pull_requests: +28582
pull_request: https://github.com/python/cpython/pull/30369

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2022-01-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 8.0 -> 9.0
pull_requests: +28581
pull_request: https://github.com/python/cpython/pull/30368

___
Python tracker 

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



[issue34931] os.path.splitext with more dots

2022-01-03 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset 51700bf08b0dd4baf998440b2ebfaa488a2855ba by Irit Katriel in 
branch 'main':
bpo-34931: [doc] clarify behavior of os.path.splitext() on paths with multiple 
leading periods (GH-30347)
https://github.com/python/cpython/commit/51700bf08b0dd4baf998440b2ebfaa488a2855ba


--

___
Python tracker 

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



[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2022-01-03 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests:  -12242

___
Python tracker 

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



[issue33376] [pysqlite] Duplicate rows can be returned after rolling back a transaction

2022-01-03 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

GH-26026 / bpo-44092 has removed the old workaround where pending statements 
were reset before a rollback. Since version 3.7.11, SQLite no longer has any 
issues with pending statements and rollbacks, so we remove the workaround, 
since we require SQLite 3.7.15 or newer in CPython.

As a side effect, pysqlite_do_all_statements() has now been removed, as it is 
unused code.

Following GH-26026, this issue is no longer an issue; I close it as fixed.


Ma Lin: if you have problems with the LRU cache, please open a new issue.

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset dd6c35761a4cd417e126a2d51dd0b89c8a30e5de by Pablo Galindo Salgado 
in branch 'main':
bpo-46110: Restore commit e9898bf153d26059261ffef11f7643ae991e2a4c
https://github.com/python/cpython/commit/dd6c35761a4cd417e126a2d51dd0b89c8a30e5de


--

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

https://speed.python.org/timeline/#/?exe=12&ben=python_startup&env=4&revs=50&equid=off&quarts=on&extr=on

also doesn't show any difference with the revert

--

___
Python tracker 

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



[issue46009] sending non-None values makes generator raise StopIteration on next access

2022-01-03 Thread Brandt Bucher


Change by Brandt Bucher :


--
nosy: +brandtbucher
nosy_count: 3.0 -> 4.0
pull_requests: +28580
pull_request: https://github.com/python/cpython/pull/30367

___
Python tracker 

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



[issue46248] Compilation errors on macOS

2022-01-03 Thread Sandip Shah


New submission from Sandip Shah :

macOS Monterey 12.1
Python 3.10.1

Trying to compile libplist, libimobiledevice, libimobiledevice_glue generates 
the error
"Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable."

The fix is change the following lines (570-571) in 
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/_sysconfigdata__darwin_darwin.py

from:
'LINKFORSHARED': '-Wl,-stack_size,100  -framework CoreFoundation '
  'Python.framework/Versions/3.10/Python',
to:
'LINKFORSHARED': '-Wl,-stack_size,100  -framework CoreFoundation '
  '/Library/Frameworks/Python.framework/Versions/3.10/Python',

Also, change the following line (110) in 
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/config-3.10-darwin

from:
LINKFORSHARED=  -Wl,-stack_size,100  -framework CoreFoundation 
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
to:
LINKFORSHARED=  -Wl,-stack_size,100  -framework CoreFoundation 
$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)

It seems the problem got created from - https://bugs.python.org/issue15298 - 
and most likely it exists in all the versions of Python (it exists in the 
native Python 2.7.18 that comes with macOS too.

Thanks.

--
components: macOS
messages: 409611
nosy: ned.deily, ronaldoussoren, sandipshah
priority: normal
severity: normal
status: open
title: Compilation errors on macOS
type: compile error
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



[issue43122] Python Launcher doesn't open a terminal window

2022-01-03 Thread Kevin


Kevin  added the comment:

Many thanks for notifying me that my issue is fixed in the latest updates. I 
will try to test this soon.

Kevin Weidenbaum

> On Jan 3, 2022, at 1:59 AM, Ned Deily  wrote:
> 
> 
> Change by Ned Deily :
> 
> 
> --
> Removed message: https://bugs.python.org/msg409563
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue46020] Optimize long_pow for the common case

2022-01-03 Thread Tim Peters


Tim Peters  added the comment:

I was suprised that

https://bugs.python.org/issue44376 

managed to get i**2 to within a factor of 2 of i*i's speed. The overheads of 
running long_pow() at all are high! Don't overlook that initialization of stack 
variables at the start, like

PyLongObject *z = NULL;  /* accumulated result */

isn't free - code has to be generated to force zeroes into those variables. The 
initialization of `table[]` alone requires code to fill 256 memory bytes with 
zeroes (down to 128 on current main branch). Nothing is free.

We can't sanely move the `table` initialization expense into the "giant k-ary 
window exponentiation" block either, because every bigint operation can fail 
("out of memory"), and the macros for doing the common ones (MULT and REDUCE) 
can do "goto Error;", and that common exit code has no way to know what is or 
isn't initialized. We can't let it see uninitialized stack trash.

The exit code in turn has a string of things like

Py_DECREF(a);
Py_DECREF(b);
Py_XDECREF(c);

and those cost cycles too, including tests and branches.

So the real "outrage" to me is why x*x took 17.6 nsec for x == 10 in the 
original report. That's many times longer than the HW takes to do the actual 
multiply. Whether it's spelled x*x or x**2, we're overwhelming timing 
overheads. `pow()` has many because it's a kind of Swiss army knife doing all 
sorts of things; what's `x*x`'s excuse? ;-)

--

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I ran the benchmarks machines with the revert and seems that it doesn't go back 
to the previous timing:

https://speed.python.org/timeline/#/?exe=12&ben=python_startup&env=1&revs=50&equid=off&quarts=on&extr=on

(check last data point for 
https://github.com/python/cpython/commit/9d35dedc5e7e940b639230fba93c763bd9f19c09).

So this seems that the difference in speed remains a mystery but is not due to 
this fix.

--

___
Python tracker 

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



[issue44092] [sqlite3] Remove special rollback handling

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



[issue44092] [sqlite3] Remove special rollback handling

2022-01-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9d6a239a34a66e16188d76c23a3a770515ca44ca by Erlend Egeberg 
Aasland in branch 'main':
bpo-44092: Don't reset statements/cursors before rollback (GH-26026)
https://github.com/python/cpython/commit/9d6a239a34a66e16188d76c23a3a770515ca44ca


--
nosy: +pablogsal

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

I wrote a tiny script that calls compile() on raw bytes read from some source 
file, does this 100 times, and reports the total time. I tested the script with 
Lib/pydoc_data/topics.py (which happens to be the largest source file in the 
CPython repo, but mostly string literals) and with Lib/test/test_socket.py (the 
second-largest file).

I built python.exe on a Mac with PGO/LTO, from "make clean", both before and 
after (at) PR 30177. For both files, the difference between the results is well 
in the noise caused by my machine (I don't have a systematic way to stop 
background jobs). But it's very clear that this PR cannot have been the cause 
of an 85% jump in the time taken by the python_startup benchmark in 
PyPerformance.

For topics.py, the time was around 7.2 msec/compile; for test_socket.py, it was 
around 38. (I am not showing separate before/after numbers because the noise in 
my data really is embarrassing.)

The compilation speed comes down to ~170,000 lines/sec on my machine (an Intel 
Mac from 2019; 2.6 GHz 6-Core Intel Core i7 running macOS Big Sur 11.6.1; it 
has clang 12.0.5).

It must be something weird on the benchmark machines. I suspect that a new 
version of some package was installed in the venv shared by all the benchmarks 
(we are still using PyPerformance 1.0.2) and that affected something, perhaps 
through a .pth file?

--

___
Python tracker 

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



[issue46247] in xml.dom.minidom, Node and DocumentLS appear to be missing __slots__

2022-01-03 Thread Arie Bovenberg


New submission from Arie Bovenberg :

(as instructed in bpo-46244, I've created this ticket)

The classes Node and DocumentLS don't define __slots__, but a number of 
subclasses do.
This appears to be a mistake.

If so, I'd like to create a PR to fix it.

--
components: Library (Lib)
messages: 409605
nosy: ariebovenberg
priority: normal
severity: normal
status: open
title: in xml.dom.minidom, Node and DocumentLS appear to be missing __slots__
versions: Python 3.10, Python 3.11, 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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
pull_requests: +28579
pull_request: https://github.com/python/cpython/pull/30366

___
Python tracker 

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



[issue46246] importlib.metadata.DeprecatedList appears to be missing __slots__

2022-01-03 Thread Arie Bovenberg


New submission from Arie Bovenberg :

(as instructed in bpo-46244, I've created this ticket)

The subclass `EntryPoints` defines __slots__, but its base `DeprecatedList` 
does not.

This appears to be a mistake.

If so, I'd like to create a PR to fix it.

--
components: Library (Lib)
messages: 409604
nosy: ariebovenberg
priority: normal
severity: normal
status: open
title: importlib.metadata.DeprecatedList appears to be missing __slots__
versions: Python 3.10, 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



[issue46244] typing._TypeVarLike missing __slots__

2022-01-03 Thread Arie Bovenberg


Arie Bovenberg  added the comment:

Thanks! I'll open new issues shortly on xml and importlib

--

___
Python tracker 

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



[issue46244] typing._TypeVarLike missing __slots__

2022-01-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

Confirmed about _TypeVarLike. Go ahead and make a PR. Do add a news blurb when 
requested.

Please open separate issues for other such classes, each fix may need to be 
reviewed by a different expert.

--

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 9d35dedc5e7e940b639230fba93c763bd9f19c09 by Pablo Galindo Salgado 
in branch 'main':
Revert "bpo-46110: Add a recursion check to avoid stack overflow in the PEG 
parser (GH-30177)" (GH-30363)
https://github.com/python/cpython/commit/9d35dedc5e7e940b639230fba93c763bd9f19c09


--

___
Python tracker 

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



[issue46033] Duplicated sentence in for statement documentation

2022-01-03 Thread Michał D

Michał D  added the comment:

Please see the changes I suggested in my PR.

--

___
Python tracker 

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



[issue25927] add dir_fd for mkstemp, and also maybe to all tempfile.*

2022-01-03 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +Add support for dir_fd in shutil.rmtree()

___
Python tracker 

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



[issue46245] Add support for dir_fd in shutil.rmtree()

2022-01-03 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

It is necessary in particularly for supporting dir_fd in the tempfile module 
(issue25927).

--
components: Library (Lib)
messages: 409599
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add support for dir_fd in shutil.rmtree()
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue45923] Improve performance of sys.settracing based tools.

2022-01-03 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> I propose a test: revert the PR and see if speed.Python.org shows a speedup
back to the previous number.--

Ok, let's do that and see what happens

--

___
Python tracker 

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



[issue46208] os.path.normpath change between 3.11.0a2 and 3.11.0a3+

2022-01-03 Thread neonene


Change by neonene :


--
keywords: +patch
nosy: +neonene
nosy_count: 3.0 -> 4.0
pull_requests: +28576
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30362

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


--
keywords: +patch
nosy: +hugovk
nosy_count: 9.0 -> 10.0
pull_requests: +28575
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30361

___
Python tracker 

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



[issue46217] 3.11 build failure on Win10: new _freeze_module changes?

2022-01-03 Thread Eryk Sun


Eryk Sun  added the comment:

With just PATHCCH_ALLOW_LONG_PATHS, PathCchCombineEx() returns a long path as a 
normal path (i.e. not a \\?\ extended path) if long-path support is enabled for 
the current process. Otherwise, if long-path support isn't enabled or 
available, as is always the case in Windows 8.1, then PATHCCH_ALLOW_LONG_PATHS 
makes PathCchCombineEx() return a long path as an extended path. In most cases, 
extended paths work fine. A common exception is that extended paths aren't 
supported for the working directory.

In Windows 10+, PATHCCH_FORCE_ENABLE_LONG_NAME_PROCESS forces 
PathCchCombineEx() to always return a long path as a normal path, even if 
long-path support is disabled for the current process. For most cases, this 
option pretty much guarantees that long paths will cause immediate failures if 
long-path support is disabled for the current process. In some cases one might 
want an immediate failure, instead of messing around with extended paths that 
might fail in some obscure, buggy way. Also, for pure path manipulation one may 
not care whether the current process can access the path without the \\?\ 
prefix.

--
nosy: +eryksun

___
Python tracker 

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



[issue42369] Reading ZipFile not thread-safe

2022-01-03 Thread Thomas


Thomas  added the comment:

@khaledk I finally got some time off, so here you go 
https://github.com/1/ParallelZipFile

I can not offer any support for a more correct implementation of the zip 
specification due to time constraints, but maybe the code is useful for you 
anyway.

--

___
Python tracker 

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



[issue46242] Improve error message when attempting to extend an enum with `__call__`

2022-01-03 Thread Alex Waygood


Change by Alex Waygood :


--
title: Improve error message when creating an enum with `__call__` -> Improve 
error message when attempting to extend an enum with `__call__`

___
Python tracker 

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



[issue46244] typing._TypeVarLike missing __slots__

2022-01-03 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +gvanrossum, kj

___
Python tracker 

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



[issue28546] [doc] Clarify setting pdb breakpoints

2022-01-03 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


--
keywords: +patch
nosy: +hugovk
nosy_count: 4.0 -> 5.0
pull_requests: +28574
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30360

___
Python tracker 

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



[issue46217] 3.11 build failure on Win10: new _freeze_module changes?

2022-01-03 Thread Steve Dower


Steve Dower  added the comment:

Good catch. We still support 8.1 for this release, so that flag will have to be 
taken out (and hopefully people won't be impacted by long path names here).

--

___
Python tracker 

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



[issue46226] User specific paths added to System PATH environment variable

2022-01-03 Thread Steve Dower


Steve Dower  added the comment:

If you have them, can you share your install logs (look in %TEMP% for files 
starting with "Python"). If not, please share your install options.

By default, this works fine. You have to make some specific modifications to 
the install options to do what you've done, such as choosing to install for all 
users and then overriding the install path to a per-user location. If you're 
installing just for yourself, the installer shouldn't even have the permissions 
required to modify system-wide environment variables.

It's also possible that your machine has a special configuration to do this, in 
which case you'll need to speak with your administrator to find out why. We 
can't help with that - we just use standard MSIs and let the OS choose where 
things go.

--

___
Python tracker 

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



[issue46110] compile("-"*3000000 + "4", '', mode) causes hard crash

2022-01-03 Thread Guido van Rossum


Guido van Rossum  added the comment:

I propose a test: revert the PR and see if speed.Python.org shows a speedup
back to the previous number.--
--Guido (mobile)

--

___
Python tracker 

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



[issue23183] timeit CLI best of 3: undocumented output format

2022-01-03 Thread Hugo van Kemenade


Change by Hugo van Kemenade :


--
keywords: +patch
nosy: +hugovk
nosy_count: 5.0 -> 6.0
pull_requests: +28573
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/30359

___
Python tracker 

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



[issue24905] Allow incremental I/O to blobs in sqlite3

2022-01-03 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

(the bpo bot is obviously confused by the News entry path, sigh)

--

___
Python tracker 

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



[issue24905] Allow incremental I/O to blobs in sqlite3

2022-01-03 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Slimmed PR diff (excluding clinic), without context manager and mapping 
protocol:

$  git diff main Modules/_sqlite/*.[ch] Lib Doc Misc PC* setup.py
 Doc/includes/sqlite3/blob.py  |  12 +
 Doc/includes/sqlite3/blob_with.py |  12 +
 Doc/library/sqlite3.rst   |  73 ++
 Doc/whatsnew/3.11.rst |   4 +
 Lib/test/test_sqlite3/test_dbapi.py   | 165 
+-
 Misc/NEWS.d/next/Library/2018-04-18-16-15-55.bpo-24905.jYqjYx.rst |   3 +
 Modules/_sqlite/blob.c| 342 
+
 Modules/_sqlite/blob.h|  24 ++
 Modules/_sqlite/connection.c  |  83 ++-
 Modules/_sqlite/connection.h  |   5 +-
 Modules/_sqlite/module.c  |   6 +-
 Modules/_sqlite/module.h  |   1 +
 PCbuild/_sqlite3.vcxproj  |   2 +
 PCbuild/_sqlite3.vcxproj.filters  |   6 +
 setup.py  |   1 +
 15 files changed, 733 insertions(+), 6 deletions(-)


Looks promising.

--

___
Python tracker 

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



  1   2   >