[issue46886] ARM64 Windows Non-Debug 3.x: random build error: failure during conversion to COFF: file invalid or corrupt

2022-02-28 Thread STINNER Victor


STINNER Victor  added the comment:

example: https://buildbot.python.org/all/#/builders/730/builds/4081

Build FAILED.
   
"C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\PCbuild\pcbuild.proj"
 (Build target) (1) ->
   
"C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\PCbuild\pyexpat.vcxproj"
 (Build target) (26) ->
   (Link target) -> 
 LINK : fatal error LNK1123: failure during conversion to COFF: file 
invalid or corrupt 
[C:\Workspace\buildarea\3.x.linaro-win-arm64.nondebug\build\PCbuild\pyexpat.vcxproj]
0 Warning(s)
1 Error(s)

--
title: pyexpat occasionally fails to build on the ARM64 Windows Non-Debug 3.x 
buildbot -> ARM64 Windows Non-Debug 3.x: random build error: failure during 
conversion to COFF: file invalid or corrupt

___
Python tracker 

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



[issue10149] [doc] Data truncation in expat parser

2022-02-28 Thread Stanley


Change by Stanley :


--
keywords: +patch
nosy: +slateny
nosy_count: 6.0 -> 7.0
pull_requests: +29752
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/31629

___
Python tracker 

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



[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2022-02-28 Thread Adrian Garcia Badaracco


Adrian Garcia Badaracco  added the comment:

I am not sure if that solves anything (other than the fact that __new__ is much 
less common to implement than __init__), but I may just be slow to pick up the 
implications of moving the check to __new__

--

___
Python tracker 

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



[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2022-02-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Would it make sense to enforce the no-instantiation rule in __new__ instead of 
__init__?

--

___
Python tracker 

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



[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2022-02-28 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

It doesn't make logical sense to instantiate any Protocol, whether it has 
__init__ or not, because a Protocol is inherently an abstract class. But we can 
just leave enforcement of that rule to static type checkers, so Adrian's 
proposed change makes sense to me.

--

___
Python tracker 

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



[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2022-02-28 Thread Adrian Garcia Badaracco


Adrian Garcia Badaracco  added the comment:

Guido, it looks like you replied while I was typing my reply out.

Yurii can correct me here but I believe PR #27543 was an attempt to disallow 
defining `__init__` on a Protocol completely. What I proposed above is the 
opposite behavior, while still fixing the issue of `__init__` getting silently 
overridden (which is the crux / title of this issue).

I'm not sure which approach is right.

--

___
Python tracker 

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



[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2022-02-28 Thread Adrian Garcia Badaracco


Adrian Garcia Badaracco  added the comment:

Agreed.

What if we allow protocols that implement `__init__` but still disallow 
instantiating a protocol that does not? It's a 1 line change, all existing 
tests pass and it would still catch what I think was the original intention 
(trying to instantiate a Protocol class with no __init__): 
https://github.com/python/cpython/pull/31628/files#diff-ddb987fca5f5df0c9a2f5521ed687919d70bb3d64eaeb8021f98833a2a716887

--

___
Python tracker 

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



[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2022-02-28 Thread Adrian Garcia Badaracco


Change by Adrian Garcia Badaracco :


--
pull_requests: +29750
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/31628

___
Python tracker 

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



[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2022-02-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Oops.

So this is an intentional feature -- Protocol replaces __init__ so that you 
can't (accidentally) instantiate a protocol. And the code to do this has 
changed a couple of times recently to deal with some edge cases. At least one 
of the PRs was by Yurii, who created this issue. I didn't read through all that 
when I closed the issue, so I'm reopening it.

Maybe Yurii can devise a solution? (Although apparently their first attempt, 
https://github.com/python/cpython/pull/27543 was closed without merging.) Yurii 
and Lukasz should probably figure this out.

--
resolution: third party -> 
stage: resolved -> test needed
status: closed -> open

___
Python tracker 

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



[issue46848] Use optimized string search function in mmap.find()

2022-02-28 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

PR 31625 is an alternative proposal.

It uses the Crochemore and Perrin's Two-Way algorithm that @benrg references 
(see Objects/stringlib/fastsearch.h and 
Objects/stringlib/stringlib_find_two_way_notes.txt), and is 
platform-independent.

--

___
Python tracker 

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



[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2022-02-28 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

Regardless of mypy's behavior (which isn't impacted by what typing.py does), 
there's a legitimate complaint here about the runtime behavior: any `__init__` 
method defined in a Protocol gets silently replaced.

>>> from typing import Protocol
>>> class X(Protocol):
... def __init__(self, x, y): pass
... 
>>> X.__init__


Fixing that won't be easy though, unless we give up on making it impossible to 
instantiate a Protocol.

--

___
Python tracker 

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



[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-02-28 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

That sounds good. Feel free to request review from me if you make a PR.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue17505] [doc] email.header.Header.__unicode__ does not decode header

2022-02-28 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

The messages above are very old and seem to be discussing Python 2. There is no 
`__unicode__` method any more, for example, though there is a `__str__` method 
which presumably does what `__unicode__` used to do. It is documented now at 
https://docs.python.org/3.10/library/email.header.html#email.header.Header.__str__
 . You'll have to do some more digging to figure out whether the OP's complaint 
still applies.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue46868] Improve performance of math.prod with bignums (and functools.reduce?)

2022-02-28 Thread Tim Peters


Tim Peters  added the comment:

> the total number of trailing 1 bits in the integers from 1
> through N inclusive is N - N.bit_count()

Sorry, that's the total number of trailing 0 bits. The total number of trailing 
1 bits is (N+1) - (N+1).bit_count().

--

___
Python tracker 

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



[issue6778] False positives given through bisect module (binary search)

2022-02-28 Thread Paola Cosio


Change by Paola Cosio :


--
assignee:  -> docs@python
components: +Distutils, Documentation, Installation, Parser, email
nosy: +barry, docs@python, dstufft, eric.araujo, lys.nikolaou, pablogsal
type: behavior -> security

___
Python tracker 

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



[issue28516] contextlib.ExitStack.__enter__ has trivial but undocumented behavior

2022-02-28 Thread Vidhya


Vidhya  added the comment:

[Entry level contributor seeking guidance] If this is still open, I can update 
the document.

After reading all the above comments, planning to add 

"The __enter__ method returns the ExitStack instance, and performs no 
additional operations." 

at

https://docs.python.org/3/library/contextlib.html#contextlib.ExitStack.enter_context.
 

Please let me know your thoughts.

--
nosy: +vidhya

___
Python tracker 

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



[issue46868] Improve performance of math.prod with bignums (and functools.reduce?)

2022-02-28 Thread Tim Peters


Tim Peters  added the comment:

About runtime, you're right. I did a ballpark "OK, if there are N incoming 
values, the inner loop has to go around, for each one, looking for a NULL, 
across a vector of at most log2(N) entries. So N * log2(N)". But, in fact, it's 
highly skewed toward getting out early, and 2*N is an upper bound on the total 
number of inner loop iterations. Strongly related to that the total number of 
trailing 1 bits in the integers from 1 through N inclusive is N - N.bit_count().

For the rest, I'll only repeat that if this goes in, it should be as a new 
function. Special-casing, e.g., math.prod() is a Bad Idea. We can have no idea 
in advance whether the iterable is type-homogenous, or even whether the __mul__ 
methods the types involved implement are even intended to be associative. 

functools.reduce() clearly documents strict "left to right" evaluation.

But a new treereduce() can do anything it feels like promising.

--

___
Python tracker 

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



[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-28 Thread Stanley


Stanley  added the comment:

I feel like there might be some backwards compatibility issues if pkgutil wraps 
it like that, but similarly I'm not at all familiar with how common the package 
is used and whether it'd be fine to make that change, so I'll also differ 
judgement here.

--

___
Python tracker 

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



[issue6634] [doc] sys.exit() called from threads other than the main one: undocumented behaviour

2022-02-28 Thread Vidhya


Vidhya  added the comment:

[Entry level contributor seeking guidance]
If this is still open, I can work on this.

I plan to add the following in sys.exit() and add a reference to thread.exit() 
at https://docs.python.org/3/library/sys.html#sys.exit:

When called from a thread other than the main thread, this causes the thread to 
exit silently, and is equivalent to calling :func:`thread.exit`.

Please correct if anything wrong.

--
nosy: +vidhya

___
Python tracker 

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



[issue17505] [doc] email.header.Header.__unicode__ does not decode header

2022-02-28 Thread Vidhya


Vidhya  added the comment:

[Entry level contributor seeking guidance] If this is still open, I like to 
work on this.

Also, planning to add the following(if no PR yet created) at make_header API at 
https://docs.python.org/3/library/email.header.html :

To get unicode strings use the API as shown below:
 unicode(make_header(decode_header('=?gb2312?b?1eLKx9bQzsSy4srUo6E=?=')))

If email policy parameter is set as 'policy.default' then the default policy, 
for that Python version, is used for header encoding and decoding. 

Please correct me if anything wrong.

--
nosy: +vidhya

___
Python tracker 

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



[issue46848] Use optimized string search function in mmap.find()

2022-02-28 Thread Dennis Sweeney


Change by Dennis Sweeney :


--
nosy: +Dennis Sweeney
nosy_count: 2.0 -> 3.0
pull_requests: +29749
pull_request: https://github.com/python/cpython/pull/31625

___
Python tracker 

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



[issue46791] Allow os.remove to defer to rmdir

2022-02-28 Thread Eryk Sun


Eryk Sun  added the comment:

> For REMOVE_BOTH, I don't see the need of calling GetFileAttributes

I was thinking that the NtQueryAttributesFile() system call is relatively cheap 
compared to a full open, especially if the attributes of a remote file are 
cached locally. However, on second thought, it's probably not. An open can fail 
as soon as it knows that there's a file/directory type mismatch. This should be 
able to take advantage of a local attribute cache instead of incurring network 
latency.

> so I think there's no reason to combine it with the other two.

REMOVE_DIR can be separate, for the current behavior. But I wanted all modes 
handled in one function in case later on we decide to fix os.rmdir() in 
Windows. It allows deleting a directory symlink. Note that the os.lstat() 
result reports a directory symlink as an S_IFLNK file, not S_IFDIR, so the 
os.rmdir() behavior is internally inconsistent. This could be corrected by 
forcing the REMOVE_DIR mode to raise NotADirectoryError. For example:

} else { // mode != REMOVE_BOTH

WIN32_FIND_DATAW data;
BOOL isDir = FALSE;
BOOL isLnk = FALSE;

HANDLE hFind = FindFirstFileW(path->wide, );
if (hFind != INVALID_HANDLE_VALUE) {
FindClose(hFind);
isDir = data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY;
if (data.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
if (mode == REMOVE_DIR) {
isLnk = data.dwReserved0 == IO_REPARSE_TAG_SYMLINK;
} else {
isLnk = IsReparseTagNameSurrogate(data.dwReserved0);
}
}
}

if ((mode == REMOVE_DIR) && (isDir && isLnk)) {
SetLastError(ERROR_DIRECTORY); // POSIX ENOTDIR
} else if ((mode == REMOVE_DIR) || (isDir && isLnk)) {
success = RemoveDirectoryW(path->wide);
} else {
success = DeleteFileW(path->wide);
}
}

--

___
Python tracker 

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



[issue46863] Python 3.10 OpenSSL Configuration Issues

2022-02-28 Thread Adam


Adam  added the comment:

Update, the Pyenv team confirmed that they do not install OpenSSL in linux, its 
only installed for MacOS, and it should be built using the system OpenSSL 
within Linux.

We're investigating further to attempt to debug the issue. Interestingly the 
OpenSSL build flags for both Python versions appear to be the same.

`Trying link with OPENSSL_LDFLAGS=; OPENSSL_LIBS=-lssl -lcrypto; 
OPENSSL_INCLUDES=`

I've attached the build logs for both the Python 3.9.10 and 3.10.2 build, in 
case you're able to review. Many thanks.

https://github.com/pyenv/pyenv/issues/2257

--
Added file: https://bugs.python.org/file50653/python_builds.tar.gz

___
Python tracker 

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



[issue46753] Statically allocate and initialize the empty tuple.

2022-02-28 Thread Eric Snow


Change by Eric Snow :


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



[issue46868] Improve performance of math.prod with bignums (and functools.reduce?)

2022-02-28 Thread benrg


benrg  added the comment:

>That memory frugality adds a log2 factor to the runtime.

Your iterative algorithm is exactly the one I had in mind, but it doesn't have 
the run time that you seem to think. Is that the whole reason for our 
disagreement?

It does only O(1) extra work (not even amortized O(1), really O(1)) for each 
call of the binary function, and there are exactly n-1 calls. There's a log(n) 
term (not factor) for expanding the array and skipping NULLs in the final 
cleanup. The constant factor for it is tiny since the array is so small.

I implemented it in C and benchmarked it against reduce with unvarying 
arguments (binary | on identical ints), and it's slightly slower around 75% of 
the time, and slightly faster around 25% of the time, seemingly at random, even 
in the same test, which I suppose is related to where the allocator decides to 
put the temporaries. The reordering only needs to have a sliver of a benefit 
for it to come out on top.

When I said "at the cost of a log factor" in the first message, I meant 
relative to algorithms like ''.join, not left-reduce.


>I suspect the title of this report referenced "math.prod with bignums" because 
>it's the only actual concrete use case you had ;-)

I led with math.prod because its evaluation order isn't documented, so it can 
be changed (and I guess I should have said explicitly that there is no up-front 
penalty to changing it beyond tricky cache locality issues). I said "bignums" 
because I had in mind third-party libraries and the custom classes that I 
mentioned in my last message. I put ? after reduce because its 
left-associativity is documented and useful (e.g. with nonassociative 
functions), so it would have to be extended or a new function added, which is 
always a hard sell. I also wanted the title to be short. I did the best I could.

--

___
Python tracker 

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



[issue46771] Add some form of cancel scopes

2022-02-28 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 7d611b4cabaf7925f5f94daddf711d54aeae2cf9 by Guido van Rossum in 
branch 'main':
bpo-46771: Remove two controversial lines from Task.cancel() (GH-31623)
https://github.com/python/cpython/commit/7d611b4cabaf7925f5f94daddf711d54aeae2cf9


--

___
Python tracker 

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



[issue46886] pyexpat occasionally fails to build on the ARM64 Windows Non-Debug 3.x buildbot

2022-02-28 Thread Eric Snow


New submission from Eric Snow :

example: https://buildbot.python.org/all/#/builders/730/builds/4081

--
components: Build
messages: 414223
nosy: eric.snow, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: pyexpat occasionally fails to build on the ARM64 Windows Non-Debug 3.x 
buildbot
versions: Python 3.11

___
Python tracker 

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



[issue46753] Statically allocate and initialize the empty tuple.

2022-02-28 Thread Eric Snow


Eric Snow  added the comment:


New changeset 08deed1af56bec8668c6cb4d5cfd89e393e1fe5e by Eric Snow in branch 
'main':
bpo-46753: Add the empty tuple to the _PyRuntimeState.global_objects. (gh-31345)
https://github.com/python/cpython/commit/08deed1af56bec8668c6cb4d5cfd89e393e1fe5e


--

___
Python tracker 

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



[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2022-02-28 Thread Ned Deily


Change by Ned Deily :


--
pull_requests:  -29746

___
Python tracker 

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



[issue46771] Add some form of cancel scopes

2022-02-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Everyone,

I've sent a PR (which I expect will make it into alpha 6) that restores the old 
cancel() semantics. This should make Tin happy, but I think we'll still have to 
have a longer discussion about the downsides.

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

--

___
Python tracker 

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



[issue46771] Add some form of cancel scopes

2022-02-28 Thread Guido van Rossum


Change by Guido van Rossum :


--
pull_requests: +29748
pull_request: https://github.com/python/cpython/pull/31623

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-02-28 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +29747
pull_request: https://github.com/python/cpython/pull/31622

___
Python tracker 

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



[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2022-02-28 Thread Roundup Robot


Change by Roundup Robot :


--
nosy: +python-dev
nosy_count: 17.0 -> 18.0
pull_requests: +29746
pull_request: https://github.com/python/cpython/pull/31606

___
Python tracker 

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



[issue46791] Allow os.remove to defer to rmdir

2022-02-28 Thread benrg


benrg  added the comment:

The REMOVE_DIR case reduces to

return RemoveDirectoryW(path->wide) ? 0 : -1;

so I think there's no reason to combine it with the other two.

The REMOVE_BOTH case is

attrs = GetFileAttributesW(path->wide);

if (attrs != INVALID_FILE_ATTRIBUTES && (attrs & FILE_ATTRIBUTE_DIRECTORY)) 
{
success = RemoveDirectoryW(path->wide);
} else {
success = DeleteFileW(path->wide);
}

return success ? 0 : -1;

For REMOVE_BOTH, I don't see the need of calling GetFileAttributes - couldn't 
you just try DeleteFile, and if that fails, RemoveDirectory?

--
nosy: +benrg

___
Python tracker 

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



[issue46868] Improve performance of math.prod with bignums (and functools.reduce?)

2022-02-28 Thread Tim Peters


Tim Peters  added the comment:

Too abstract for me to find compelling. I suspect the title of this report 
referenced "math.prod with bignums" because it's the only actual concrete use 
case you had ;-)

Here's another: math.lcm. That can benefit for the same reason as math.prod - 
provoking Karatsuba multiplication. However, applying lcm to a largish 
collection of ints is so rare I can't recall ever seeing it done.

Here's a related anti-example: math.gcd. Tree reduction hurts that. It 
typically falls to 1 quickly, and tree reduction just delays that.

So I'm at best -0 on this, and I'll stop now.

For reference, here's a Python implementation that strives to match 
functools.reduce's signature and endcase behaviors. It accepts any iterable, 
and requires temp space at most about log2(number of elements the iterable 
delivers in all).

That memory frugality adds a log2 factor to the runtime. The O() speed penalty 
could be eliminated by using temp memory that grows to about half the number of 
elements in the iterable.

def treereduce(function, iterable, initializer=None):
levels = []
if initializer is not None:
levels.append(initializer)
NULL = object()
for y in iterable:
for i, x in enumerate(levels):
if x is NULL:
levels[i] = y
break
y = function(x, y)
levels[i] = NULL
else:
levels.append(y)
y = NULL
for x in levels:
if x is not NULL:
y = x if y is NULL else function(x, y)
if y is NULL:
raise TypeError("treereduce() of empty iterable with no initial 
value")
return y

Then, for example,

>>> treereduce(lambda x, y: f"({x}+{y})", "abcdefghijk")
'a+b)+(c+d))+((e+f)+(g+h)))+((i+j)+k))'

--

___
Python tracker 

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



[issue46808] remove NEXT_BLOCK() from compile.c

2022-02-28 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



[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2022-02-28 Thread Irit Katriel


Irit Katriel  added the comment:

> Irit, you just patched Temp file doc, can you look at the PR code?


I don't consider myself and expert here, but I left a comment on PR29560 just 
to be a good sport.

--

___
Python tracker 

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



[issue46885] Ensure PEP 663 changes are reverted from 3.11

2022-02-28 Thread Thomas Wouters


Change by Thomas Wouters :


--
nosy: +twouters

___
Python tracker 

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



[issue46885] Ensure PEP 663 changes are reverted from 3.11

2022-02-28 Thread Ethan Furman


Ethan Furman  added the comment:

This has been taken care of in issue40066.

--

___
Python tracker 

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



[issue46868] Improve performance of math.prod with bignums (and functools.reduce?)

2022-02-28 Thread benrg


benrg  added the comment:

Anything that produces output of O(m+n) size in O(m+n) time. Ordered merging 
operations. Mergesort is a binary ordered merge with log-depth tree reduction, 
and insertion sort is the same binary operation with linear-depth tree 
reduction. Say you're merging sorted lists of intervals, and overlapping 
intervals need special treatment. It's easier to write a manifestly correct 
binary merge than an n-way merge, or a filter after heapq.merge that needs to 
deal with complex interval clusters. I've written that sort of code.

Any situation that resembles a fast path but doesn't qualify for the fast path. 
For example, there's an optimized factorial function in math, but you need 
double factorial. Or math.prod is optimized for ints as you suggested, but you 
have a class that uses ints internally but doesn't pass the CheckExact test. 
Usually when you miss out on a fast path, you just take a (sometimes large) 
constant-factor penalty, but here it pushes you into a different complexity 
class. Or you have a class that uses floats internally and wants to limit 
accumulated roundoff errors, but the struture of the computation doesn't fit 
fsum.

>Tree reduction is very popular in the parallel processing world, for obvious 
>reasons.

It's the same reason in every case: the log depth limits the accumulation of 
some bad thing. In parallel computing it's critical-path length, in factorial 
and mergesort it's size, in fsum it's roundoff error. Log depth helps in a 
range of situations.

>I've searched in vain for other languages that try to address this "in general"

You've got me there.

>As Guido will tell you, the only original idea in Python is adding an "else" 
>clause to loops ;-)

I don't think that's really true, except in the sense that there's nothing new 
under the sun. No one would use Python if it was just like other languages 
except slower and with for-else.

--

___
Python tracker 

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



[issue46885] Ensure PEP 663 changes are reverted from 3.11

2022-02-28 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> we need to ensure that the changes made in 3.11 (see 
> https://github.com/python/steering-council/issues/76#issuecomment-970668967) 
> are rejected.

Apologies, I meant "we need to ensure that the changes made in 3.11 are 
**reverted**.

--

___
Python tracker 

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



[issue46885] Ensure PEP 663 changes are reverted from 3.11

2022-02-28 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

As PEP 663 https://github.com/python/steering-council/issues/76 was rejected, 
we need to ensure that the changes made in 3.11 (see 
https://github.com/python/steering-council/issues/76#issuecomment-970668967) 
are rejected.

I am marking this as a release blocker so we don't forget.

--
assignee: ethan.furman
messages: 414214
nosy: ethan.furman, pablogsal
priority: release blocker
severity: normal
status: open
title: Ensure PEP 663 changes are reverted from 3.11
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



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Rotzbua


Rotzbua  added the comment:

Thanks for pointing out the logical change from "true" to "True".
I do not want to start a discussion about principles.

Nevertheless I think a change from `platform(aliased=0, terse=0)` to 
`platform(aliased=False, terse=False)` makes the how-to-use more intuitive.

The change does not change any function behavior or breaks any backwards 
compatibilities.

I created a new PR without the change of "true".

--

___
Python tracker 

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



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Rotzbua


Change by Rotzbua :


--
pull_requests: +29745
pull_request: https://github.com/python/cpython/pull/31621

___
Python tracker 

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



[issue45991] Improve ambiguous docstrings in pkgutil

2022-02-28 Thread Kevin Hock


Kevin Hock  added the comment:

> Maybe instead a note could be put in the Pathlib doc noting functions that 
> accept path arguments might not accept Path objects?

My concern with that is that someone using `pkgutil` wouldn't see it. However, 
I can see the argument that fixing the 'source' is better than each use. I'm 
not sure how wide-spread these kind of issues are to weigh in on how many 
'uses' there are. If that makes sense.

>Should pkgutil call os.fspath() in this case?

I really like that idea. (I haven't contributed to CPython before, so I'll let 
someone else weigh in on if that is standard practice.)

--

___
Python tracker 

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



[issue46880] zipfile library doesn't extract windows zip files properly on linux

2022-02-28 Thread Martin Fischer


Martin Fischer  added the comment:

Can you attach such a .zip file so that others can reproduce the bug?

--
nosy: +push-f

___
Python tracker 

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



[issue46884] [doc] msilib.rst uses data directive to document modules

2022-02-28 Thread Martin Fischer


Martin Fischer  added the comment:

([2] was meant to be an online link: 
https://docs.python.org/3.9/py-modindex.html#cap-m)

--

___
Python tracker 

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



[issue46884] [doc] msilib.rst uses data directive to document modules

2022-02-28 Thread Martin Fischer


Change by Martin Fischer :


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

___
Python tracker 

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



[issue46884] [doc] msilib.rst uses data directive to document modules

2022-02-28 Thread Martin Fischer


New submission from Martin Fischer :

As per [1] the py:data directive describes data in a module.
It should not be used for submodules, that's what the module directive is for. 
A side-effect that this is causing is that msilib.schema, msilib.sequence 
and msilib.text do not show up in the Python Module Index[2] as they should.

[1]: https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html
[2]: 
file:///home/martin/repos-contrib/cpython/Doc/build/html/py-modindex.html#cap-m

--
assignee: docs@python
components: Documentation
messages: 414209
nosy: docs@python, push-f
priority: normal
severity: normal
status: open
title: [doc] msilib.rst uses data directive to document modules
type: enhancement
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



[issue46814] Documentation for constructing abstract base classes is misleading

2022-02-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

Raymond, I agree that this is going too far. I believe the OP has taken the 
position that "abstract" has only one meaning and it is defined by 
inspect.isabstract(). I disagree with this.

An ABC is an ABC is an ABC, and it provides certain functionality through the 
ABCMeta metaclass: (1) forbid instantiation when at least one 
@abstractmethod-decorated method exist that isn't overridden, and (2) virtual 
subclasses.

Calling out that a class with metaclass=ABCMeta is only abstract when it has at 
least one @abstractmethod left, over and over, is not helpful.

--

___
Python tracker 

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



[issue44807] typing.Protocol silently overrides __init__ method of delivered class

2022-02-28 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> third party
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



[issue21761] [doc] language reference describes the role of module.__file__ inaccurately

2022-02-28 Thread Vidhya


Vidhya  added the comment:

Thanks Alex. I will look into @slateny's patch.

--

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-02-28 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +29743
pull_request: https://github.com/python/cpython/pull/31618

___
Python tracker 

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



[issue46883] Add glossary entries to clarify the true/True and false/False distinction

2022-02-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Note also that this is mentioned here:

https://docs.python.org/3/library/stdtypes.html#boolean-values

"[True and False] are used to represent truth values (although other values can 
also be considered false or true)."

although it is perhaps not as clear as I would prefer.

Also relevant is this:

https://docs.python.org/3/library/stdtypes.html#truth-value-testing

--

___
Python tracker 

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



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

See #46883

--

___
Python tracker 

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



[issue46883] Add glossary entries to clarify the true/True and false/False distinction

2022-02-28 Thread Steven D'Aprano


New submission from Steven D'Aprano :

There is a long-standing tradition, going back to Python 1.x days before we had 
dedicated True and False values, to use the lowercase "true" and "false" to 
mean *any value that duck-types as True* and *any value that duck-types as 
False* in a boolean context.

Other terms for this same concept include "truthy/falsey" and using true/false 
as adjectives rather than nouns, e.g. "a true value".

But I am not sure whether this is actually written down anywhere in the 
documentation.

It would be useful for those who are not aware of the convention (e.g. 
beginners and people coming from other languages) if the Glossary had entries 
for lowercase "true" and "false" that explained the usage and referred back to 
PEP 285. See for example #46882 where this came up.

I suggest something like the following:

boolean context
  Code such as ``if condition:`` and ``while condition:`` which causes the 
expression ``condition`` to be evaluated as if it were a :class:`bool`.

false
  Any object which evaluates to the :class:`bool` singleton ``False`` in a 
:term:`boolean context`. Informally known as "falsey". See :term:`true` and 
:pep:`285`. Among the builtins , false values include ``None``, empty 
containers and strings, and zero numbers.

true
  Any object which evaluates to the :class:`bool` singleton ``True`` in a 
:term:`boolean context`. Informally known as "truthy". See :term:`false` and 
:pep:`285`. Among the builtins , true values include non-empty containers and 
strings, non-zero numbers (including NANs), and all other objects by default.

--
assignee: docs@python
components: Documentation
messages: 414204
nosy: docs@python, steven.daprano
priority: normal
severity: normal
status: open
title: Add glossary entries to clarify the true/True and false/False distinction
type: enhancement
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



[issue46878] [sqlite3] remove "non-standard" from docstrings

2022-02-28 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

As one of the people confused by this wording, I agree with dropping it. There 
is no documentation that I can find that explains what "non-standard" means.

I'll leave the PR for some time though in case others have objections.

--

___
Python tracker 

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



[issue45431] [C API] Rename CFrame or hide it to only export names starting with Py

2022-02-28 Thread STINNER Victor


Change by STINNER Victor :


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



[issue45431] [C API] Rename CFrame or hide it to only export names starting with Py

2022-02-28 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, CFrame has been renamed.

> We should either make the whole PyThreadState structure private (move it to 
> the internal C API)

This idea is tracked by bpo-39947.

--

___
Python tracker 

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



[issue45431] [C API] Rename CFrame or hide it to only export names starting with Py

2022-02-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7496f9587306772b56ed074092c020f3ef16bf95 by Victor Stinner in 
branch 'main':
bpo-45431: Rename CFrame to _PyCFrame in the C API (GH-31584)
https://github.com/python/cpython/commit/7496f9587306772b56ed074092c020f3ef16bf95


--

___
Python tracker 

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



[issue46748] Python.h includes stdbool.h

2022-02-28 Thread STINNER Victor


STINNER Victor  added the comment:

> Thank you, Kumar & Victor, for fixing up the issue!

You're welcome. I'm happy to see that you reduced the number of #include in the 
C API ;-) I made similar changes in bpo-45434.

--

___
Python tracker 

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



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

> Both arguments `aliased` and `terse` should be boolean instead of integer.

Why should they be strictly True/False booleans? I disagree strongly that they 
should be. Any object that duck-types as a true or false value is sufficient.

Treated as a documentation change, your PR is wrong because it implies that 
*only* the singletons `True` and `False` are acceptable, when in fact any true 
and false (note the lowercase) values are acceptable.

Personally, I prefer the terms "truthy" and "falsey", or "a true value" and "a 
false value" over a bare true/false, but some people do not, and it is a 
long-standing tradition in Python circles to understand lowercase true/false as 
the duck-typed values as opposed to the `True` and `False` bool singletons.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Rotzbua


Change by Rotzbua :


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

___
Python tracker 

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



[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Rotzbua


New submission from Rotzbua :

Problem:
Both arguments `aliased` and `terse` should be boolean instead of integer.

Description:
The function is as `platform.platform(aliased=0, terse=0)` so both arguments 
`aliased` and `terse` seems to be numbers.
The documentation says: "If aliased is true,[..]" which gives a hint that the 
type should be boolean instead of an integer.
Looking into the implementation both arguments used as boolean.

Solution:
Update documentation and set default argument values to `False` instead of `0`.

Reference:
Current documentation: 
https://docs.python.org/3.11/library/platform.html#platform.platform

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 414198
nosy: Rotzbua, docs@python
priority: normal
severity: normal
status: open
title: Clarify argument type of platform.platform(aliased, terse) to boolean
type: enhancement
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



[issue46849] Memory problems detected using Valgrind

2022-02-28 Thread tongxiaoge


tongxiaoge  added the comment:

Ok, thanks. There is no memory problem exposed when I add 
--suppressions=Misc/valgrind-python.supp. I will close this issue.

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



[issue46871] Lambda can't be pickled with "spawn" and only "fork"

2022-02-28 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The default start method for multirprocessing was changed from "fork" to 
"spawn" on macOS. This was done because the "fork" method can easily be 
triggered into causing hard crashes (on macOS), in particular when the parent 
proces has called higher-level systemen APIs.

The "spawn" method requires pickling the data and callable passed to the child 
proces, and that's not supported for lambda's.

--
components: +macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue46881] Statically allocate and initialize the latin1 characters.

2022-02-28 Thread Kumar Aditya


Change by Kumar Aditya :


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

___
Python tracker 

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



[issue46881] Statically allocate and initialize the latin1 characters.

2022-02-28 Thread Kumar Aditya


New submission from Kumar Aditya :

Statically allocate and initialize the latin1 characters. This *should* make 
iterating over a ascii strings faster as it avoids an atomic read in 
PyInterpreterState_GET() to get unicode state in get_latin1_char, makes 
get_latin1_char branchless and can be used in deepfreeze for identifiers.

--
components: Interpreter Core
messages: 414195
nosy: Mark.Shannon, eric.snow, gvanrossum, kumaraditya303
priority: normal
severity: normal
status: open
title: Statically allocate and initialize the latin1 characters.
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



[issue46841] Inline bytecode caches

2022-02-28 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 4558af5a8f8e56a9b0dc11f6e834c47e0fd05f9e by Mark Shannon in 
branch 'main':
bpo-46841: Move the cache for `LOAD_GLOBAL` inline. (GH-31575)
https://github.com/python/cpython/commit/4558af5a8f8e56a9b0dc11f6e834c47e0fd05f9e


--

___
Python tracker 

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



[issue46879] [doc] incorrect sphinx object names

2022-02-28 Thread Martin Fischer


Change by Martin Fischer :


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

___
Python tracker 

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



[issue46880] zipfile library doesn't extract windows zip files properly on linux

2022-02-28 Thread Nimrod Fiat


New submission from Nimrod Fiat :

Created a zip file using Powershell's Compress-Archive method. 
Moved the file to Debian. 
Used zipfile's extractall method to extract. 
The result was a flat directory with long file names such as:
"migrated-image952821\\m4a\\runiis.ps". 
I would expect instead for a "migrated-image952821" directory to be created, 
containing an "m4a" directory which contains "runiis.ps"

--
components: Library (Lib)
messages: 414193
nosy: nimrodf
priority: normal
severity: normal
status: open
title: zipfile library doesn't extract windows zip files properly on linux
type: behavior
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



[issue46879] [doc] incorrect sphinx object names

2022-02-28 Thread Martin Fischer


New submission from Martin Fischer :

API members documented in sphinx have an object name, which allow the
documentation to be linked from other projects. Sphinx calculates the
object name by prefixing the current module name to the directive
argument, e.g:

.. module:: foo
.. function:: bar.baz

becomes foo.bar.baz. Since these anchors aren't displayed in the
documentation, some mistakes have crept in, namely the Python stdlib
documentation currently contains the objects:

* asyncio.asyncio.subprocess.DEVNULL
* asyncio.asyncio.subprocess.PIPE
* asyncio.asyncio.subprocess.STDOUT
* asyncio.asyncio.subprocess.Process
* multiprocessing.sharedctypes.multiprocessing.Manager
* xml.etree.ElementTree.xml.etree.ElementInclude

As can be observed in the URL fragments:
https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.asyncio.subprocess.Process
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.sharedctypes.multiprocessing.Manager
https://docs.python.org/3/library/xml.etree.elementtree.html#xml.etree.ElementTree.xml.etree.ElementInclude.default_loader

I have a patch, prepared, I'll send a PR straight away.

--
assignee: docs@python
components: Documentation
messages: 414192
nosy: docs@python, push-f
priority: normal
severity: normal
status: open
title: [doc] incorrect sphinx object names
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



[issue46672] NameError in asyncio.gather when passing a invalid type as an arg with multiple awaitables

2022-02-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Correct. 
3.8 is in security mode.
It doesn't accept regular patches

--

___
Python tracker 

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



[issue46567] Add Tcl/Tk builds for ARM64

2022-02-28 Thread Steve Dower


Steve Dower  added the comment:

Build and tests were fine, and a test release build was too, so merging and 
closing this.

Any new Tcl/Tk issues should get a new bug. If they only affect ARM64, just 
mention that in the issue.

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



[issue46567] Add Tcl/Tk builds for ARM64

2022-02-28 Thread Steve Dower


Steve Dower  added the comment:


New changeset da7d99a4de72aac8d436cecedf16ab2676f9b785 by Steve Dower in branch 
'main':
bpo-46567: Add Tcl/Tk build for Windows ARM64 (GH-31574)
https://github.com/python/cpython/commit/da7d99a4de72aac8d436cecedf16ab2676f9b785


--

___
Python tracker 

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



[issue46841] Inline bytecode caches

2022-02-28 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset 424ecab494d538650ba34937cdd710094ccb2275 by Brandt Bucher in 
branch 'main':
bpo-46841: Use inline caching for `UNPACK_SEQUENCE` (GH-31591)
https://github.com/python/cpython/commit/424ecab494d538650ba34937cdd710094ccb2275


--

___
Python tracker 

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



[issue30698] asyncio sslproto do not shutdown ssl layer cleanly

2022-02-28 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Agree

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



[issue46877] [doc] unittest.doModuleCleanups() does not exist

2022-02-28 Thread Kumar Aditya


Change by Kumar Aditya :


--
pull_requests: +29738
pull_request: https://github.com/python/cpython/pull/31613

___
Python tracker 

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



[issue46877] [doc] unittest.doModuleCleanups() does not exist

2022-02-28 Thread Kumar Aditya


Change by Kumar Aditya :


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

___
Python tracker 

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



[issue38854] Decorator with paren tokens in arguments breaks inspect.getsource

2022-02-28 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood

___
Python tracker 

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



[issue38854] Decorator with paren tokens in arguments breaks inspect.getsource

2022-02-28 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +yselivanov
versions:  -Python 3.7, Python 3.8

___
Python tracker 

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



[issue46877] [doc] unittest.doModuleCleanups() does not exist

2022-02-28 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303

___
Python tracker 

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



[issue38854] Decorator with paren tokens in arguments breaks inspect.getsource

2022-02-28 Thread Adam Hopkins


Change by Adam Hopkins :


--
nosy: +ahopkins
nosy_count: 3.0 -> 4.0
pull_requests: +29736
pull_request: https://github.com/python/cpython/pull/31605

___
Python tracker 

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



[issue46878] [sqlite3] remove "non-standard" from docstrings

2022-02-28 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue46878] [sqlite3] remove "non-standard" from docstrings

2022-02-28 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

Several sqlite3 methods are "marked" as non-standard in their docstrings. This 
is an historic artefact which (I assume) implies that a method is not a part of 
the DB-API defined by PEP 249. Questions regarding the "non-standard" strings 
arise from time to time, as the meaning is not immediately obvious.

The question surfaced in a code review in October 2021[^1], and again in a more 
recent PR[^2].

Suggesting to purge "non-standard" from all docstrings once and for all to 
avoid more confusion.

[^1]: https://github.com/python/cpython/pull/28463#discussion_r724371832
[^2]: https://github.com/python/cpython/pull/26728#discussion_r815523101

--
messages: 414186
nosy: Jelle Zijlstra, erlendaasland
priority: normal
severity: normal
status: open
title: [sqlite3] remove "non-standard" from docstrings
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



[issue46877] [doc] unittest.doModuleCleanups() does not exist

2022-02-28 Thread Martin Fischer


Change by Martin Fischer :


--
title: unittest.doModuleCleanups() does not exist -> [doc] 
unittest.doModuleCleanups() does not exist

___
Python tracker 

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



[issue46567] Add Tcl/Tk builds for ARM64

2022-02-28 Thread Steve Dower


Steve Dower  added the comment:

I updated the builds in cpython-bin-deps and retriggered the PR tests.

--

___
Python tracker 

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



[issue46567] Add Tcl/Tk builds for ARM64

2022-02-28 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the analysis. It should be fine to set PlatformToolset=v142 to 
choose the older compiler, so I'll give that a go.

Anything I can do to help the compiler team figure out what's broken?

--

___
Python tracker 

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



[issue46748] Python.h includes stdbool.h

2022-02-28 Thread Petr Viktorin


Petr Viktorin  added the comment:

Thank you, Kumar & Victor, for fixing up the issue!

I meant to check the buildbots before closing the issue, but got side-tracked.

--
stage: patch review -> 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



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

2022-02-28 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset c32aef48533769161e1247927a5b418322e0860c by Erlend Egeberg 
Aasland in branch 'main':
bpo-46541: Remove unneeded visits from sqlite3 (GH-31609)
https://github.com/python/cpython/commit/c32aef48533769161e1247927a5b418322e0860c


--

___
Python tracker 

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



[issue43884] Cannot cleanly kill a subprocess using high-level asyncio APIs

2022-02-28 Thread Kumar Aditya


Change by Kumar Aditya :


--
keywords: +patch
nosy: +kumaraditya303
nosy_count: 5.0 -> 6.0
pull_requests: +29734
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/31611

___
Python tracker 

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



[issue43884] Cannot cleanly kill a subprocess using high-level asyncio APIs

2022-02-28 Thread Kumar Aditya


Change by Kumar Aditya :


--
versions: +Python 3.11 -Python 3.8, Python 3.9

___
Python tracker 

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



[issue23453] [doc] Clarify bytes vs text with non-seeking tarfile stream

2022-02-28 Thread Stanley


Change by Stanley :


--
keywords: +patch
nosy: +slateny
nosy_count: 3.0 -> 4.0
pull_requests: +29733
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/31610

___
Python tracker 

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



[issue36484] Can't reorder TLS 1.3 ciphersuites

2022-02-28 Thread Sanchayan Ghosh


Change by Sanchayan Ghosh :


Added file: 
https://bugs.python.org/file50652/0001-Add-TLS-v1.3-cipher-suite-set-function.patch

___
Python tracker 

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



[issue36484] Can't reorder TLS 1.3 ciphersuites

2022-02-28 Thread Sanchayan Ghosh


Change by Sanchayan Ghosh :


Removed file: 
https://bugs.python.org/file50650/0001-Add-TLS-v1.3-cipher-suite-set-function.patch

___
Python tracker 

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



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

2022-02-28 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +29732
pull_request: https://github.com/python/cpython/pull/31609

___
Python tracker 

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