[issue43574] Regression in overallocation for literal list initialization in v3.9+

2021-04-03 Thread Chad Netzer


Chad Netzer  added the comment:

For bpo-43574, my initial plan was to change list_resize() so that it wouldn't
overallocate empty lists that were resized to be bigger, thus restoring the
overallocation behavior for list-literals to be like that of earlier Python
releases.

However, the list_resize() helper is also used by list appends and inserts, as
well as other list methods that change list sizes.  This proposed strategy of
not-overallocating any resize that starts with an empty list also affects
their behavior, and with the list-overallocation calculation that was
introduced with bpo-38373, this causes unexpected side-effects on the amount
of overallocation used for appending/inserting with an empty list.

Therefore, my updated proposal handles this by changing the overallocation
behavior in list_resize() only when empty lists are increased by an amount
greater than 1 during list_resize().  This basically retains the behavior of
not overallocating list-literals, while not changing the behavior for list
append/insert on an empty list.

To understand why this updated proposed change won't also cause overallocation
for length-1 literals, see below how length-1 and length-2 list-literals are
compiled using BUILD_LIST instead of LIST_EXTEND:

```
Python 3.9.2 (default, Mar 26 2021, 23:27:12)
>>> import dis
>>> def foo():
...   [1]
...
>>> dis.dis(foo)
  2   0 LOAD_CONST   1 (1)
  2 BUILD_LIST   1
  4 POP_TOP
  6 LOAD_CONST   0 (None)
  8 RETURN_VALUE
>>> def bar():
...   [1,2]
...
>>> dis.dis(bar)
  2   0 LOAD_CONST   1 (1)
  2 LOAD_CONST   2 (2)
  4 BUILD_LIST   2
  6 POP_TOP
  8 LOAD_CONST   0 (None)
 10 RETURN_VALUE
>>> def baz():
...   [1,2,3]
...
>>> dis.dis(baz)
  2   0 BUILD_LIST   0
  2 LOAD_CONST   1 ((1, 2, 3))
  4 LIST_EXTEND  1
  6 POP_TOP
  8 LOAD_CONST   0 (None)
 10 RETURN_VALUE
```


Hence, the change to list_resize(), which is called by list_extend() but not
the BUILD_LIST opcode, won't impact list-literals of length 1 and 2.


And to show how the originally proposed change (no overallocation for
list_resize() of empty lists) inadvertently changed how list append/insert
overallocation worked, let's first take a look at how current Python (3.9+)
works:

```
>>> l = []
>>> l.__sizeof__()
40
>>> l.append("a")  # First append will overallocate to capacity 4
>>> l.__sizeof__()
72
>>> l.append("b")
>>> l.__sizeof__()
72
>>> l.append("c")
>>> l.__sizeof__()
72
>>> l.append("d")
>>> l.__sizeof__()
72
>>> l.append("e")
>>> l.__sizeof__()
104
>>> l2 = ["a"]  # Length 1 (and 2) literals don't overallocate
>>> l2.__sizeof__()
48
>>> # However, note that the first append will overallocate to capacity 8
>>> l2.append("b")
>>> l2.__sizeof__()
104
```

Note that the list-literal of length 1 isn't overallocated, and that
appending to it skips the capacity 4 list and goes straight to capacity 8.

However, with my originally proposed change, this overallocation behavior is
duplicated even for lists that start empty, because the first append then
effectively becomes a non-overallocated list of length and capacity 1, which
means that the second append overallocates to capacity 8.

Here was the overallocation behavior of my first proposal, when an empty list
was appended:
```
Python 3.10.0a6+ (heads/bpo43574-dont-overallocate-list-literals:7436223a71, 
Apr  3 2021, 16:32:22) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin
>>> l = []
>>> l.__sizeof__()
40
>>> l.append("a")
>>> l.__sizeof__()  # No overallocation on first append
48
>>> l.append("b")
>>> l.__sizeof__()  # Second append jumps to capacity 8, skipping 4
104
```

This is unexpected and likely undesirable behavior, as lists being created
empty and then appended to should be expected to follow the same documented 4,
8, 16, 24, ...  growth pattern for bpo-38373.

Fixing this is fairly simple because of the special-casing for length 1 and 2
list-literals, just by checking for the use of append/insert on an empty list.
Because they both change the size of a length 0 list to length 1, and the
list_resize() for literals always kicks in for changing to lengths 3 or more,
this updates proposal will retain the current empty-list insert/append
overallocation behavior, while still allowing list-literals of length 1 or
more to not overallocate.

With this updated proposal, avoiding a change to the behavior of an empty list
append/insert, the overallocation for list-literals is still removed, and the
current overallocation behavior for empty lists being appended is preserved:
```
Python 3.10.0a6+ (heads/bpo43574-dont-overallocate-list-literals-v2:56b361221d, 
Apr  3 2021, 17:35) [Clang 12.0.0 (clang-1200.0.32.29)] on darwin
>>> l = []
>>> 

[issue43725] Create a release branch ABI stability regression test

2021-04-03 Thread Gregory P. Smith


New submission from Gregory P. Smith :

In order to automate prevention of ABI regressions in stable releases, we could 
create an automated ABI stability test generator and check the specific ABI 
test it generates into each specific release branch.

I'm envisioning the main branch only having a code generator that creates such 
a test, and the release branches only having the output of that as 
Lib/tests/release_X_Y_ABI_stability_test.py and a policy of never updating that 
within a release branch without *extreme* attention to detail.

Such updates wouldn't happen by default in our current workflow as they're 
unique and versioned in every release branch so automated backport PRs wouldn't 
touch them - leaving CI to run them and highlight failures on attempted 
backports to do inadvertently cause an ABI shift.

--
components: Build, C API, Interpreter Core, Tests
messages: 390173
nosy: gregory.p.smith
priority: normal
severity: normal
stage: needs patch
status: open
title: Create a release branch ABI stability regression test
type: enhancement
versions: Python 3.10, 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



[issue43710] Access violations in C extension modules on Python 3.9.3

2021-04-03 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I really suggest a simple rollback (revert) of the change rather than a 
redo-fix for 3.9.4.  Unless you like the idea of a possible 3.9.5 if the 
redo-fix itself has issues that haven't been given due thought in the rush to 
undo the 3.9.3 mistake.

This leaves more time for a proper fix of bpo-42500 in 3.9 not crafted under 
duress.

--

___
Python tracker 

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



[issue42500] crash with unbounded recursion in except statement

2021-04-03 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +gregory.p.smith
nosy_count: 7.0 -> 8.0
pull_requests: +23921
pull_request: https://github.com/python/cpython/pull/25179

___
Python tracker 

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



[issue43710] Access violations in C extension modules on Python 3.9.3

2021-04-03 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
nosy: +gregory.p.smith
nosy_count: 7.0 -> 8.0
pull_requests: +23920
pull_request: https://github.com/python/cpython/pull/25179

___
Python tracker 

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



[issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values.

2021-04-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


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



[issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values.

2021-04-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset de0b2b133011953b02536cc78f2499d5d55224f8 by Miss Islington (bot) 
in branch '3.9':
bpo-43325: Add FAQ entry for identity tests (GH-25168) (GH-25178)
https://github.com/python/cpython/commit/de0b2b133011953b02536cc78f2499d5d55224f8


--

___
Python tracker 

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



[issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values.

2021-04-03 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +23919
pull_request: https://github.com/python/cpython/pull/25178

___
Python tracker 

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



[issue43724] macOS cannot compute sizeof (long double)

2021-04-03 Thread Allen


Change by Allen :


--
title: cannot compute sizeof (long double) -> macOS cannot compute sizeof (long 
double)

___
Python tracker 

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



[issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values.

2021-04-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset f8775e4f72240faba3947eea8efdd83ee56ae1fd by Raymond Hettinger in 
branch 'master':
bpo-43325: Add FAQ entry for identity tests (GH-25168)
https://github.com/python/cpython/commit/f8775e4f72240faba3947eea8efdd83ee56ae1fd


--

___
Python tracker 

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



[issue43724] cannot compute sizeof (long double)

2021-04-03 Thread Allen


Change by Allen :


--
files: config.log
nosy: allenlili
priority: normal
severity: normal
status: open
title: cannot compute sizeof (long double)
type: compile error
versions: Python 3.9
Added file: https://bugs.python.org/file49933/config.log

___
Python tracker 

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



[issue43714] re.split(), re.sub(): '\Z' must consume end of string if it matched

2021-04-03 Thread Alexander Grigoriev


Alexander Grigoriev  added the comment:

For example, sed:

$ sed --version
sed (GNU sed) 4.8
Copyright (C) 2020 Free Software Foundation, Inc.

$ sed -e 's/-\?$/x/g' <<<'a-b-'
a-bx

Perl:
$ perl --version

This is perl 5, version 32, subversion 0 (v5.32.0) built for 
x86_64-msys-thread-multi

Copyright 1987-2020, Larry Wall
$ perl -e 'my $x="a-b-"; $x =~ s/-?$/x/g; print $x'
a-bxx

https://www.freeformatter.com/java-regex-tester.html

Java Regular Expression :
-?$
Entry to test against :
a-b-c-
String replacement result:
a-b-cx

During replacement or split, a match consumes the matched character. It's easy 
to forget that "end of line" should be considered a (pseudo)character and must 
also be consumed if it matched.

--

___
Python tracker 

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



[issue27129] Wordcode, part 2

2021-04-03 Thread Ned Deily


Change by Ned Deily :


--
priority: normal -> release blocker
versions: +Python 3.10 -Python 3.6

___
Python tracker 

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



[issue34816] raise AttributeError if loading fails in ctypes.LibraryLoader.__getattr__

2021-04-03 Thread Ateeq Sharfuddin


Ateeq Sharfuddin  added the comment:

First patch fixing only the issue at hand on master. LibraryLoader now catches 
OSError for FileNotFoundError and raises AttributeError.

--
Added file: https://bugs.python.org/file49932/34816.patch

___
Python tracker 

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



[issue34816] raise AttributeError if loading fails in ctypes.LibraryLoader.__getattr__

2021-04-03 Thread Ateeq Sharfuddin


Change by Ateeq Sharfuddin :


--
keywords: +patch
nosy: +ateeq
nosy_count: 2.0 -> 3.0
pull_requests: +23918
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/25177

___
Python tracker 

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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
priority: normal -> critical

___
Python tracker 

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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thanks everyone for the rapid responses.  The PR fixes the build for me, with a 
clean test suite pass, so I added reviewers who could merge, a blurb, and my 
approval.  This can be closed as out-of-date as soon as the (or a) fix is 
merged.

--

___
Python tracker 

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



[issue20503] super behaviour and abstract base classes (either implementation or documentation/error message is wrong)

2021-04-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue43723] Deprecate camelCase aliases from threading.py

2021-04-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I don't think there is any advantage in doing this. It will just break code 
that has worked for a very long time.

This is the reason that the logging module wasn't changed to more modern naming 
conventions.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37804] Remove Thread.isAlive in Python 3.9

2021-04-03 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


--
pull_requests: +23916
pull_request: https://github.com/python/cpython/pull/25174

___
Python tracker 

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



[issue43723] Deprecate camelCase aliases from threading.py

2021-04-03 Thread Jelle Zijlstra


Change by Jelle Zijlstra :


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

___
Python tracker 

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



[issue43723] Deprecate camelCase aliases from threading.py

2021-04-03 Thread Jelle Zijlstra


New submission from Jelle Zijlstra :

Followup from issue37804: deprecate the remaining camelCase aliases, such as 
threading.currentThread. PR coming soon.

--
assignee: Jelle Zijlstra
components: Library (Lib)
messages: 390165
nosy: Jelle Zijlstra, pitrou
priority: normal
severity: normal
status: open
title: Deprecate camelCase aliases from threading.py
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



[issue43340] json.load() can raise UnicodeDecodeError, but this is not documented

2021-04-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue43709] Windows Tools\buildbot\clean.bat misses some needed pyc/pyo removal

2021-04-03 Thread David Bolen


David Bolen  added the comment:

Based on further information in issue #27129 as well as issue #43719 it appears 
a source of the problem prompting this fix was a failure to update the magic 
number in the original commit for #27129.

The windows clean script does still leave more artifacts than, for example, the 
Unix Makefile, but it shouldn't have resulted in a problem if the magic number 
had changed, and it's not clear it has to change after all.  So this issue can 
probably be closed once that is corrected.

--

___
Python tracker 

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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

Correction: I opened GH-25172

--

___
Python tracker 

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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I could not successfully build even with deletion of __pycache__ in subfolders. 
I finally got the build to succeed after changing the magic number, so I opened 
GH-25069.

--

___
Python tracker 

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



[issue43721] Documentation of property.{getter, setter, deleter} fails to mention that a *new* property is returned

2021-04-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: rhettinger -> 

___
Python tracker 

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



[issue27129] Wordcode, part 2

2021-04-03 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
pull_requests: +23913
pull_request: https://github.com/python/cpython/pull/25172

___
Python tracker 

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



[issue43721] Documentation of property.{getter, setter, deleter} fails to mention that a *new* property is returned

2021-04-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384)

2021-04-03 Thread Skip Montanaro


Skip Montanaro  added the comment:

I should revise that comment. The xxlimited and xxlimited_35 modules fail to 
build. That seems suboptimal, but perhaps is to be expected. Perhaps it would 
be better that compiling them not be attempted with configuring 
--with-trace-refs?

--

___
Python tracker 

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



[issue43722] PEP 597: FileCookieJar uses locale encoding

2021-04-03 Thread Inada Naoki


New submission from Inada Naoki :

During fixing EncodingWarning in stdlibs, I found FileCookieJar, LWPCookieJar, 
and MozillaCookieJar use locale encoding for cookie files.

I don't know much about cookie file format. If locale encoding is right 
encoding, we can just use `encoding="locale"` since Python 3.10.

Or cookie files should be encoded in UTF-8, or latin-1?

--
components: Library (Lib)
messages: 390160
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 597: FileCookieJar uses locale encoding
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



[issue41111] [C API] Convert a few stdlib extensions to the limited C API (PEP 384)

2021-04-03 Thread Skip Montanaro


Skip Montanaro  added the comment:

The latest commit seems to break the build if configured --with-trace-refs.

--
nosy: +skip.montanaro

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-03 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +23912
pull_request: https://github.com/python/cpython/pull/25171

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-03 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 35715d1e72b7e15e337087863c75af447199e0fb by Inada Naoki in branch 
'master':
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25145)
https://github.com/python/cpython/commit/35715d1e72b7e15e337087863c75af447199e0fb


--

___
Python tracker 

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



[issue27129] Wordcode, part 2

2021-04-03 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I notice this in _bootstrap_external.py: the magic number did not get changed, 
only the comment:


# Python 3.10a2 3433 (RERAISE restores f_lasti if oparg != 0)
# Python 3.10a6 3434 (PEP 634: Structural Pattern Matching)
# Python 3.10a7 3435 Use instruction offsets (as opposed to byte offsets).

#
# MAGIC must change whenever the bytecode emitted by the compiler may no
# longer be understood by older implementations of the eval loop (usually
# due to the addition of new opcodes).
#
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.
MAGIC_NUMBER = (3434).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little')  # For import.c

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread David Bolen


David Bolen  added the comment:

Dennis, just to make sure I wasn't too literal, some of the __pycache__ folders 
are in subdirectories (at least in Tools), so just to double check, you did a 
recursive search beneath Tools and Parser right?

--

___
Python tracker 

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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I ran into the same issue on Windows 10 and git bisected it to the same first 
bad commit, fcb55c0037baab6f98f91ee38ce84b6f874f034a

The issue persists after rm .\Parser\__pycache__\*
My .\Tools directory has no __pycache__.

--
nosy: +Dennis Sweeney

___
Python tracker 

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



[issue41139] cgi uses the locale encoding for log files

2021-04-03 Thread Inada Naoki


Inada Naoki  added the comment:

+1 for removing.
But let's emit DeprecationWarning for now, and remove it later.

--
components: +Library (Lib)
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



[issue41139] cgi uses the locale encoding for log files

2021-04-03 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +methane

___
Python tracker 

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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread David Bolen


David Bolen  added the comment:

Terry, it's not clear to me if this is the same issue (at first blush it 
appears different) but could you see if you have any pyc files in __pycache__ 
folders within the Tools or Parser directories in your tree that could be from 
prior builds?  If so, remove them and try a new build?

The build.bat script's clean process is not currently cleaning them up, which 
can lead to various oddities if you reuse a source tree across the commit 
Victor references, as that invalidates the older files but they aren't 
regenerated.

--
nosy: +db3l

___
Python tracker 

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



[issue27129] Wordcode, part 2

2021-04-03 Thread David Bolen


David Bolen  added the comment:

I don't think reverting the commit at this point would necessarily be helpful.  
While it might fix some systems, it could newly break anyone who happened to do 
their first build since the commit was in place.

I didn't want to bug anyone over the weekend, but I've got a PR as part of 
issue #43709 that I believe would fix this going forward, if anyone with access 
might have an opportunity to review it.

--

___
Python tracker 

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



[issue27129] Wordcode, part 2

2021-04-03 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset fcb55c0037baab6f98f91ee38ce84b6f874f034a by Mark Shannon in 
> branch 'master':
> bpo-27129: Use instruction offsets, not byte offsets, in bytecode and 
> internally. (GH-25069)

This change broke buildbots, please revert it to repair buildbots.

More and more people are affected: https://bugs.python.org/issue43719

--

___
Python tracker 

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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread STINNER Victor


STINNER Victor  added the comment:

IMO it's https://bugs.python.org/issue27129#msg389991

--

___
Python tracker 

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



[issue43721] Documentation of property.{getter, setter, deleter} fails to mention that a *new* property is returned

2021-04-03 Thread Antony Lee


New submission from Antony Lee :

property.{getter,setter,deleter} returns a new property with a new 
{fget,fset,fdel}.  This is documented at 
https://docs.python.org/3/library/functions.html#property, and intended 
behavior (see e.g. https://bugs.python.org/issue1620).

However the corresponding docstrings, e.g. `pydoc property.getter`, are 
"Descriptor to change the getter (setter, deleter) on a property."  This 
wording suggests that no copy is being made and that the property is mutated 
in-place.

--
assignee: docs@python
components: Documentation
messages: 390149
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: Documentation of property.{getter,setter,deleter} fails to mention that 
a *new* property is returned

___
Python tracker 

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



[issue43652] Upgrade Windows tcl/tk to 8.6.11

2021-04-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The upgrade to 8.6.10 broke a Scale test.  The fix for that in #41306
  conv = False if get_tk_patchlevel() >= (8, 6, 10) else float_round
should still work unless there was a further Scale change.

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue43652] Upgrade Windows tcl/tk to 8.6.11

2021-04-03 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue43652] Upgrade Windows tcl/tk to 8.6.11

2021-04-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Did you use revision 0, and in 8.6.11.0, or a later one?

As I mentioned in #43719, I cannot currently build master, but I will upload a 
PR (with .0) for CI to test.

--

___
Python tracker 

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



[issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12

2021-04-03 Thread Brett Cannon


Change by Brett Cannon :


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



[issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12

2021-04-03 Thread Brett Cannon


Brett Cannon  added the comment:


New changeset dc6d3e1e4c0c1e4b2210edab8fb4762569dc2936 by Brett Cannon in 
branch 'master':
bpo-43720: Update import-related stdlib deprecation messages to say they will 
be removed in Python 3.12 (GH-25167)
https://github.com/python/cpython/commit/dc6d3e1e4c0c1e4b2210edab8fb4762569dc2936


--

___
Python tracker 

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



[issue2135] Restructure import.c into PEP 302 importer objects

2021-04-03 Thread Brett Cannon


Change by Brett Cannon :


--
pull_requests: +23910
pull_request: https://github.com/python/cpython/pull/25169

___
Python tracker 

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



[issue43679] ttk.Sizegrip disappears under Windows 10 UI Scaling, with dpiAware set true and >1 scaling

2021-04-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

In issue 33656, we determined that tcl/tk *is* dpi aware and that telling 
Windows so is needed for proper text display.  IDLE now issues the same Windows 
command (idlelib.pyshell, line 20).  This perhaps should be done by Python 
itself, but that is not my department.  In any case, without the setting, text 
in IDLE Windows is much uglier on my 27 inch 2560 x 1440 screen.

IDLE Windows do not currently have sizegrips.  This seems to be standard on 
Windows. One can resize by grabbing the bottom of the lower right corner. But 
it is a bit finicky.

When I run your code, I see the small, faint, sizegrip.  Perhaps my screen is 
not HiDpi enough to see the problem.  In any case, this is a tcl/tk issue.  
Perhaps upgrading to 8.6.11 (#43652) will help, as it is supposed to for the 
radiobutton issue.

--
nosy: +serhiy.storchaka, terry.reedy
resolution:  -> third party
stage:  -> resolved
status: open -> closed
versions: +Python 3.10 -Python 3.7

___
Python tracker 

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



[issue43325] Documentation should warn that 'is' is not a safe comparison operator for most values.

2021-04-03 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue41969] ttk.RadioButtons mis-sized under Windows 10 UI Scaling, with dpiAware set true

2021-04-03 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Re ""f:\dev\3x\PC\validate_ucrtbase.py" ucrtbased" exited with co
de -1073741819."

f:\dev\3x>py -3.10 PC\validate_ucrtbase.py ucrtbased
C:\WINDOWS\SYSTEM32\ucrtbased.DLL is version 10.0.14393.33

so the failure is due to running the file with the nonfunctional python_d.exe.

In a text editor, encodings/__init__.py looks fine.
f:\dev\3x>py -3.10 f:\dev\3x\\lib\encodings\__init__.py
(to check text further) fails at line 33
  from . import alias

In any case, line 31 is 'import codecs'.  codecs.py looks fine and
f:\dev\3x>py -3.10 f:\dev\3x\\lib\codecs.py
runs without error, so its text appears to be intact.  Perhaps one of the 
imports of compiled C fail drastically.

--

___
Python tracker 

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



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

2021-04-03 Thread Tim Peters


Tim Peters  added the comment:

BTW, your cache WIP

https://github.com/python/cpython/pull/25130/files

partly moves to tracking pool (instead of byte) addresses, but any such attempt 
faces a subtlety:  it's not necessarily the case that a pool is entirely 
"owned" by obmalloc or by the system.  It can be split.

To be concrete, picture a decimal machine with arenas at 10,000 byte boundaries 
and pools at 100-byte boundaries, with the system malloc returning 20-byte 
aligned addresses.

If obmalloc gets an arena starting at address 20,020, the pool range(2, 
20100) has its first 20 bytes owned by the system, but its last 80 bytes owned 
by obmalloc. Pass 20050 to the PR's address_in_range, and it will say it's 
owned by the system (because its _pool_ address, 2, is). But it's actually 
owned by obmalloc.

I'm not sure it matters, but it's easy to get a headache trying to out-think it 
;-) In that case, obmalloc simply ignores the partial pool at the start, and 
the first address it can pass out is 20100. So it would never be valid for 
free() or realloc() to get 20050 as an input.

On the other end, the arena would end at byte 20020 + 1 - 1 = 30019. This 
seems worse! If 30040 were passed in, that's a system address, but its _pool_ 
address is 3, which obmalloc does control.

That reminds me now why the current scheme tracks byte addresses instead ;-) It 
appears it would require more tricks to deal correctly in all cases when 
system-supplied arenas aren't necessarily aligned to pool addresses (which was 
never a consideration in the old scheme, since a pool was at largest a system 
page, and all mmap()-like functions (used to get an arena) in real life return 
an address at worst page-aligned).

Or we'd need to find ways to force mmap() (across different systems' spellings) 
to return a pool-aligned address for arenas to begin with.

--

___
Python tracker 

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



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-04-03 Thread Brett Cannon


Change by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue42135] [importlib] Deprecate find_module() & find_loader() mplementations

2021-04-03 Thread Brett Cannon


Brett Cannon  added the comment:

find_spec() also supercedes find_loader().

--

___
Python tracker 

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



[issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12

2021-04-03 Thread Brett Cannon


Change by Brett Cannon :


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

___
Python tracker 

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



[issue43720] Document various preexisting stdlib deprecations related to import for removal in Python 3.12

2021-04-03 Thread Brett Cannon


New submission from Brett Cannon :

The following module's have preexisting deprecations with no slated removal 
version. Since so much of import is getting cleaned up in Python 3.12, these 
should finally go as well so the APIs are consistent across Python.

- imp
- pkgutil
- importlib.util

--
assignee: brett.cannon
components: Library (Lib)
messages: 390141
nosy: brett.cannon
priority: normal
severity: normal
status: open
title: Document various preexisting stdlib deprecations related to import for 
removal in Python 3.12
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



[issue43719] Master build failure on Windows getting file system encoding

2021-04-03 Thread Terry J. Reedy


New submission from Terry J. Reedy :

After a fresh update from upstream
> PCbuild\build.bat -D (or without -D)
on my machine ends with

  python.vcxproj -> f:\dev\3x\PCbuild\amd64\python_d.pdb (Full PDB)
  Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = 'f:\dev\3x\Lib'
program name = 'f:\dev\3x\PCbuild\amd64\python_d.exe'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'f:\\dev\\3x\\PCbuild\\amd64\\python_d.exe'
sys.base_prefix = 'f:\\dev\\3x'
sys.base_exec_prefix = 'f:\\dev\\3x'
sys.platlibdir = 'lib'
sys.executable = 'f:\\dev\\3x\\PCbuild\\amd64\\python_d.exe'
sys.prefix = 'f:\\dev\\3x'
sys.exec_prefix = 'f:\\dev\\3x'
sys.path = [
  'f:\\dev\\3x\\Lib',
  'f:\\dev\\3x\\PCbuild\\amd64\\python310_d.zip',
  'f:\\dev\\3x\\DLLs',
  'f:\\dev\\3x\\lib',
  'f:\\dev\\3x\\PCbuild\\amd64',
]
EXEC : Fatal Python warning : init_fs_encoding: failed to get the Python codec
of the filesystem encoding [f:\dev\3x\PCbuild\python.vcxproj]
  Python runtime state: core initialized
  Traceback (most recent call last):
File "f:\dev\3x\Lib\encodings\__init__.py", line 31, in 
f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: The command "setlocal
\r
f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: set PYTHONPATH=f:\dev
\3x\Lib\r
f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: "f:\dev\3x\PCbuild\am
d64\python_d.exe" "f:\dev\3x\PC\validate_ucrtbase.py" ucrtbased" exited with co
de -1073741819.
  pythonw.vcxproj -> f:\dev\3x\PCbuild\amd64\pythonw_d.exe
  pythonw.vcxproj -> f:\dev\3x\PCbuild\amd64\pythonw_d.pdb (Full PDB)

EXEC : Fatal Python warning : init_fs_encoding: failed to get the Python codec
of the filesystem encoding [f:\dev\3x\PCbuild\python.vcxproj]
f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: The command "setlocal
\r
f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: set PYTHONPATH=f:\dev
\3x\Lib\r
f:\dev\3x\PCbuild\python.vcxproj(123,5): warning MSB3073: "f:\dev\3x\PCbuild\am
d64\python_d.exe" "f:\dev\3x\PC\validate_ucrtbase.py" ucrtbased" exited with co
de -1073741819.

I believe I pulled and rebuilt fine just a few days ago. Subsequently running
> python
ends with

Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
Traceback (most recent call last):
  File "f:\dev\3x\\lib\encodings\__init__.py", line 31, in 

Running > chkdsk F: /scan revealed no obvious disk error, but there could be 
corrupted bytes in some file, but I don't know what file(s) to check (if text) 
or delete and have git redownload.  Anyone else have a similar problem?

--
components: Build, Windows
keywords: 3.10regression
messages: 390140
nosy: pablogsal, paul.moore, steve.dower, terry.reedy, tim.golden, vstinner, 
zach.ware
priority: normal
severity: normal
status: open
title: Master build failure on Windows getting file system encoding
type: compile error
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



[issue43718] HTTP CONNECT response not subject to debug level

2021-04-03 Thread Michael Osipov


New submission from Michael Osipov <1983-01...@gmx.net>:

Looking at 
https://github.com/python/cpython/blob/63c69440c7adb0de1d191a8d3d100b335d5c2f81/Lib/http/client.py#L898
self.debuglevel is not passed to response_class() and for debugging purposes I 
miss to see:
> send: b'CONNECT some-host:443 HTTP/1.0\r\n'
> send: b'\r\n'
> reply: 'HTTP/1.0 502 Bad Gateway\r\n'

reply is missing. It trivial to pass the debug level.

--
components: Library (Lib)
messages: 390139
nosy: michael-o
priority: normal
severity: normal
status: open
title: HTTP CONNECT response not subject to debug level
versions: Python 3.10, 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



[issue43717] Confusing OSError on HTTP CONNECT failure

2021-04-03 Thread Michael Osipov


New submission from Michael Osipov <1983-01...@gmx.net>:

When working with proxies and HTTP CONNECT I came across these lines: 
https://github.com/python/cpython/blob/63c69440c7adb0de1d191a8d3d100b335d5c2f81/Lib/http/client.py#L901-L903

I truly fail to see why this is an OSError. OSErrors 
(https://docs.python.org/3/library/exceptions.html#os-exceptions) describe a 
low-level issues, but HTTP is a high level protocol. I would expect something 
like NotConnected or at least something which derives from HTTPException.

OSError is expected on socket issues only.

--
components: Library (Lib)
messages: 390138
nosy: michael-o
priority: normal
severity: normal
status: open
title: Confusing OSError on HTTP CONNECT failure
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue43716] curses.pair_number() function incorrect value under Windows

2021-04-03 Thread Peter J. Farley III


New submission from Peter J. Farley III :

curses.pair_number() result under Windows (console or Terminal window) value 
must be shifted by 16 bits to be valid to use as input to the 
curses.pair_content() function.

If the pair number result is not shifted, the call to curses.pair_content() 
fails with an overflow error:

Traceback (most recent call last):
  File "C:\Users\MyUser\test\curses-color.py", line 126, in 
curses.wrapper(main)
  File "C:\Python38\lib\curses\__init__.py", line 105, in wrapper
return func(stdscr, *args, **kwds)
  File "C:\Users\MyUser\test\curses-color.py", line 72, in main
fg, bg = curses.pair_content (pair)
OverflowError: signed short integer is greater than maximum

The attached curses program demonstrates the correct functioning using the pair 
value shift under Windows.  Comment out the "if" and shift lines to reproduce 
the overflow error.

Environment information:

Windows 10 (latest updates)
Windows cmd.exe window or Windows Terminal Version: 1.6.10571.0
Python 3.8.7
windows-curses 2.2.0

Also tested in:

Ubuntu 20.04 (WSL2)
ncurses6/focal,now 6.2-0ubuntu2 amd64

--
components: Extension Modules
files: curses-color-1.py
messages: 390137
nosy: pjfarleyiii
priority: normal
severity: normal
status: open
title: curses.pair_number() function incorrect value under Windows
versions: Python 3.8
Added file: https://bugs.python.org/file49931/curses-color-1.py

___
Python tracker 

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



[issue43715] curses inch() and scrbkgd() documentation ommissions

2021-04-03 Thread Peter J. Farley III


New submission from Peter J. Farley III :

The documentation for the result values of curses functions inch() and 
scrbkgd() or how to use those result values are omitted entirely.  
Documentation should at least describe how to use the result values of these 
functions without necessarily describing the actual format of the results, 
which do differ depending on the implementation of curses being used.

A suggestion for the documentation change is attached.

A separate issue will be filed questioning the need to shift the pair number 
result of the curses.pair_number() function in the Windows terminal environment.

--
components: Extension Modules
files: curses-doc-change.txt
messages: 390136
nosy: pjfarleyiii
priority: normal
severity: normal
status: open
title: curses inch() and scrbkgd() documentation ommissions
versions: Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49930/curses-doc-change.txt

___
Python tracker 

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



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

2021-04-03 Thread Tim Peters


Tim Peters  added the comment:

Can't really know without a system to try it on, but my best guess is that 
these asserts are the only thing that will fail with tagging enabled. The 
obvious "fix" is indeed just to skip them on a platform with tagging enabled. 
They're meant as a sanity check that only 48 bits are really used for 
addresses. Which remains true even when tagging is enabled - the tag bits are 
part of the _pointer_ on AMD, but not part of the address.

Taking tagging seriously instead would be a significant project, relying on 
platform-specific instructions. For a start, obmalloc would have to generate a 
random 4-bit integer for each object it returns, plug that into 4 specific 
"high order" bits of the pointer it returns, and tell the OS to associate those 
4 bits with each 16-byte chunk of the object's space.  mmap()-like calls would 
also need to be changed, to tell the OS to enable tag checking on the memory 
slice returned.

While caching may or may not speed things up, I'm not seeing how it _could_ 
help move to 64-bit addresses.  As is, the tree needs 8 bytes of bottom-node 
space for each arena in use, and that's independent of how many address bits 
there are (it only depends on the arena granularity).  I think that could be 
cut by a factor of 4 by keeping track of arena pool (instead of byte) 
boundaries in the bottom nodes, meaning that, with the _current_ settings, we'd 
only need to keep track of the 64=2^6 possible pool addresses in an arena, 
instead of the 2^20 possible byte addresses.  6 bits fits fine in a signed 
8-bit int (but we need a 32-bit int now to hold the 2^20 possible byte 
addresses in an arena).

So the clearest way to ease the space burden of keeping track of truly 
expansive address spaces is to boost arena size. And, if the tree bottom 
changed to keep track of pool (instead of byte) addresses, possibly boost pool 
size too.

--

___
Python tracker 

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



[issue43710] Access violations in C extension modules on Python 3.9.3

2021-04-03 Thread Łukasz Langa

Łukasz Langa  added the comment:

Tomorrow evening CEST (around 30 hours from now) I intend to release a hotfix 
3.9.4 with Mark's fix.

--
priority: normal -> release blocker

___
Python tracker 

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



[issue43705] [docs] Document that SyntaxError's offsets are 1-indexed

2021-04-03 Thread Ammar Askar


Ammar Askar  added the comment:

Aah thanks for pointing that out Terry, I didn't realize f-strings have 
different semantics for SyntaxError. Would you mind making a separate issue for 
that, I'll look into making the documentation for it clearer after I get a 
chance to investigate.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue17306] Improve the way abstract base classes are shown in help()

2021-04-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Closing this due to lack of interest.

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



[issue38794] Setup: support linking openssl statically

2021-04-03 Thread William Woodruff


William Woodruff  added the comment:

I don't think this is a productive or polite response.

If you read the issue linked, you'll note that the other flag added
(--with-openssl-rpath) is in furtherance of any *already* supported linking
scenario (dynamic, with a non-system-default OpenSSL). The proposed change
here is for an *new* linking scenario, i.e. statically linking OpenSSL.

I don't blame the maintainers for not wanting to add another build configuration
to their plate, especially for something like OpenSSL. It's up to us as end
users to make those accommodations on our own, knowing that what we're
doing isn't tested or directly supported. The resolution above is, in my
book, the ideal one.

Best,
William

On Sat, Apr 03, 2021 at 04:45:34PM +, Lukas Vacek wrote:
>
> Lukas Vacek  added the comment:
>
> For the record, this would have been solved more than a year ago already.
>
> When this change was proposed more than a year ago it was rejected with 
> "There is no need to add more configure flags to build Python with a custom 
> OpenSSL installation. " yet now it's ok to add a new option 
> --with-openssl-rpath https://bugs.python.org/issue43466 ?
>
> And the first comment there, from python core dev nonetheless, is suggesting 
> static linking as well. Emm... this would have been solved year and half ago. 
> I would be happy to completely drop my proposed (and approved on gihub) 
> changes and implement it in a different way.
>
> The maintainer's attitude as demonstrated here can be really harmful in 
> open-source projects (many of us still remember eglibc fork back in the day) 
> but fortunately this is the first time I noticed such attitude among python 
> developers.
>
> Importantly the issue is resolved now (did it take a request from IBM's 
> customer to get this implemented ;-) ?) and hopefully a lesson learnt and 
> Christian will be more welcoming and less judgemental of outsiders' 
> contributions.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue38794] Setup: support linking openssl statically

2021-04-03 Thread Lukas Vacek


Lukas Vacek  added the comment:

For the record, this would have been solved more than a year ago already.

When this change was proposed more than a year ago it was rejected with "There 
is no need to add more configure flags to build Python with a custom OpenSSL 
installation. " yet now it's ok to add a new option --with-openssl-rpath 
https://bugs.python.org/issue43466 ?

And the first comment there, from python core dev nonetheless, is suggesting 
static linking as well. Emm... this would have been solved year and half ago. I 
would be happy to completely drop my proposed (and approved on gihub) changes 
and implement it in a different way.

The maintainer's attitude as demonstrated here can be really harmful in 
open-source projects (many of us still remember eglibc fork back in the day) 
but fortunately this is the first time I noticed such attitude among python 
developers.

Importantly the issue is resolved now (did it take a request from IBM's 
customer to get this implemented ;-) ?) and hopefully a lesson learnt and 
Christian will be more welcoming and less judgemental of outsiders' 
contributions.

--

___
Python tracker 

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



[issue43701] Add this optionality

2021-04-03 Thread Ned Deily


Ned Deily  added the comment:

If you want to pursue your suggestion for a change in the language, the best 
place to do so is first on the python-ideas mailing list 
(https://mail.python.org/mailman3/lists/python-ideas.python.org/). The issue 
tracker here is more for bugs and minor enhancements.

--
nosy: +ned.deily
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue36384] ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2021-04-03 Thread Steve Dower


Steve Dower  added the comment:

(Copied from my comment on the PR, following the one where I said this was 
ready to go.)

Withdrawing the readiness - @ambv and I would prefer to see this behind a flag 
(probably "strict" parsing), on by default for 3.10, and maybe on by default 
for 3.9/earlier.

The main reasoning being that this isn't our vulnerability, but an 
inconsistency with other vulnerable libraries. The current fix is the best it 
can be, but it doesn't prevent the vulnerability, it just causes Python to 
break first. So it ought to be relatively easy to retain the flexible (though 
admittedly non-sensical) behaviour for those who currently rely on it.

--
nosy: +steve.dower

___
Python tracker 

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



[issue43714] re.split(), re.sub(): '\Z' must consume end of string if it matched

2021-04-03 Thread Matthew Barnett


Matthew Barnett  added the comment:

Do any other regex implementations behave the way you want?

In my experience, there's no single "correct" way for a regex to behave; 
different implementations might give slightly different results, so if the most 
common ones behave a certain way, then that's the de facto standard, even if it 
not what you'd expect or want.

--
nosy: +mrabarnett

___
Python tracker 

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



[issue43713] sorted() signature is not accurate in the documentation

2021-04-03 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

There is moratorium on the / notation in the main docs.   If that moratorium is 
lifted, we sweep through the docs and apply it.

--
nosy: +rhettinger
resolution:  -> later
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



[issue43711] cgi.log() uses locale encoding

2021-04-03 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue41139.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> cgi uses the locale encoding for log files

___
Python tracker 

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



[issue43714] re.split(), re.sub(): '\Z' must consume end of string if it matched

2021-04-03 Thread Alexander Grigoriev


New submission from Alexander Grigoriev :

If '\Z' matches as part of a pattern in re.sub() or re.split(), it should 
consume the end of string, and then '\Z' alone should not match the end of 
string again.

Current behavior:

Python 3.9.2 (tags/v3.9.2:1a79785, Feb 19 2021, 13:44:55) [MSC v.1928 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> print(re.split(r'/?\Z', 'a/b/c/d/'))
['a/b/c/d', '', '']
>>> print(re.sub(r'/?\Z', '-', 'a/b/c/d/'))
a/b/c/d--


Wanted behavior:

>>> print(re.split(r'/?\Z', 'a/b/c/d/'))
['a/b/c/d', '']
>>> print(re.sub(r'/?\Z', '-', 'a/b/c/d/'))
a/b/c/d-

--
components: Library (Lib)
messages: 390124
nosy: alegrigoriev
priority: normal
severity: normal
status: open
title: re.split(), re.sub(): '\Z' must consume end of string if it matched
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue43701] Add this optionality

2021-04-03 Thread Vedran Čačić

Vedran Čačić  added the comment:

Well, just reverse the order of -= in second statement. If you write =-, it 
will magically work. ;-)

But in the general case, sometimes introducing temporary variables is the 
simplest solution.

The alternative would be to implement pointwise -= for tuples, which would be 
extremely confusing since they already implement += with a completely different 
semantics.

--
nosy: +veky

___
Python tracker 

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



[issue43713] sorted() signature is not accurate in the documentation

2021-04-03 Thread Tomer Kalish


New submission from Tomer Kalish :

According to the docs, the sorted function's signature is:
sorted(iterable, *, key=None, reverse=False)
But when printing its help interactively, the signature is:
sorted(iterable, /, *, key=None, reverse=False)
The latter seems to be the correct one, as calling sorted(iterable=arr) will 
raise a TypeError.

The signature in the docs should be fixed.

--
assignee: docs@python
components: Documentation
messages: 390122
nosy: docs@python, tomer.kalish91
priority: normal
severity: normal
status: open
title: sorted() signature is not accurate in the documentation
type: resource usage
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



[issue43710] Access violations in C extension modules on Python 3.9.3

2021-04-03 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue43712] PEP 597: fileinput uses locale encoding

2021-04-03 Thread Inada Naoki


New submission from Inada Naoki :

fileinput.input() and fileinput.FileInput() don't have `encoding` parameter.

User can specify encoding by `openhook=hook_encoded("utf-8")`. But we can not 
utilize PEP 597, and `encoding="utf-8"` is more user friendly.

Additionally, `hook_compressed` doesn't have the encoding parameter. User need 
to use binary mode or locale encoding.

--
components: Library (Lib)
messages: 390121
nosy: methane
priority: normal
severity: normal
status: open
title: PEP 597: fileinput uses locale encoding
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



[issue43711] cgi.log() uses locale encoding

2021-04-03 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue43711] cgi.log() uses locale encoding

2021-04-03 Thread Inada Naoki


Change by Inada Naoki :


--
title: cgi.log() uses default encoding -> cgi.log() uses locale encoding

___
Python tracker 

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



[issue43711] cgi.log() uses default encoding

2021-04-03 Thread Inada Naoki

New submission from Inada Naoki :

See cgi.initlog():
https://github.com/python/cpython/blob/b2a91e0c9ee18b50cc86b21211c2258520a9f5d0/Lib/cgi.py#L82

```
logfp = open(logfile, "a")
```

This feature is not documented but can be used like this.

```
import cgi
cgi.logfile="myapp.log"
cgi.log("こんにちは")
```

I want to change log file encoding to UTF-8. Although this is backward 
incompatible change, it unlikely break user application because it just change 
the logfile encoding.

UTF-8 is safer than locale encoding because UTF-8 supports all valid Unicode 
strings.

--
components: Library (Lib)
messages: 390120
nosy: methane
priority: normal
severity: normal
status: open
title: cgi.log() uses default encoding
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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-03 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +23906
pull_request: https://github.com/python/cpython/pull/25159

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-03 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +23905
pull_request: https://github.com/python/cpython/pull/25158

___
Python tracker 

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



[issue43689] difflib: mention other "problematic" characters in documentation

2021-04-03 Thread Jürgen Gmach

Jürgen Gmach  added the comment:

First I need to apologize for not providing more info already when I created 
the issue.

Initially, I did not even plan to create an issue, and thought the PR with the 
context of the current documentation would be sufficient information.

Thanks for taking your time anyway!

Also, thanks to Tim for explaining the meaning of the question mark in detail. 
When I read the documentation, I also had to pause a moment to understand the 
sentence. But I agree with Tim, it is hard to explain it better without getting 
much more verbose.

My initial reason to read (and then to update) the documentation was an output 
of pytest, which left me puzzled.

E   AssertionError: assert 'ROOT: No tox...ith_no_t0/p\n' == 'ROOT: No 
tox..._with_no_t0/p'
E Skipping 136 identical leading characters in diff, use -v to show
E - ith_no_t0/p
E + ith_no_t0/p
E ?+

Here is the screenshot and some discussion:
https://twitter.com/jugmac00/status/1377317886419738624

Using a similar snippet as Tim, here is a minimal example:

for L in d.compare(["abcdefghijkl"], ["abcdefghijkl\n"]):
print(L)

- abcdefghijkl
+ abcdefghijkl

? +


Usually, the output is pretty obvious most of the time, so I never actually 
noticed the question mark - except when whitespace characters are involved.

I was then told that pytest uses difflib, and I was kindly pointed to the 
Python documentation.

As only the tab character was listed, I thought it would be a good idea to add 
the other whitespace characters as well.

After Tim's explanation, I see, that tabs could be especially confusing, while 
all whitespace characters are on a normal level of confusing :-), especially at 
the end of the diff.

I certainly won't forget what I learned, but maybe my proposal helps one fellow 
Python user or another.

--

___
Python tracker 

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



[issue37788] fix for bpo-36402 (threading._shutdown() race condition) causes reference leak

2021-04-03 Thread Martin Panter


Martin Panter  added the comment:

Anselm's pull request PR 15175 looked hopeful to me. I've been using those 
changes in our builds at work for a while.

--

___
Python tracker 

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



[issue43689] difflib: mention other "problematic" characters in documentation

2021-04-03 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

After 3+ years of Github I did not remember that B diffs use lines with 
change position markers and in particular that at they (often? always?) start 
with ?s. IDLE also uses color to mark positions (for syntax errors).  The 
following would have been clearer to me and likely to people who have never 
seen such lines.

"Location marker lines beginning with ‘?’ use symbols to guide the eye to 
intraline differences."

Tim, you seem to still think that tabs are especially problematical. 

Jürgen, without evidence otherwise, I agree with this.  Adding other chars to 
the sentence would dilute the current focus on tabs.  Hence my request for 
examples to justify doing so.  Sorry I was not as clear as I could and should 
have been.

--

___
Python tracker 

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