[issue45569] Drop support for 15-bit PyLong digits?

2021-10-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

How about: create a fake test file test/test_xintperf with test case and test 
method(s) that run timeit with a suite of int operations and print report.  
Create 'draft' PRs for main and 3.10 (and 3.9?).  Run just this test on 
buildbots.  (I believe I have seen this done.)

Improvement: write script to find buildbot results and consolidate.

Is there already a template for something like this?  If not, make one.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue45511] Batch-mode input() limited to 4095 characters on *NIX

2021-10-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
stage:  -> test needed
title: input() method limited to 4095 characters on *NIX -> Batch-mode input() 
limited to 4095 characters on *NIX
versions: +Python 3.11 -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



[issue45530] Improve listobject.c's unsafe_tuple_compare()

2021-10-22 Thread Stefan Pochmann


Stefan Pochmann  added the comment:

Yes, I'm more familiar with the issue in the context of strings or lists. Your 
example of strings like "'x' * 10_000 + str(i)" looks like something I almost 
certainly used before as counterexample to someone's time complexity claim :-)

I the context of multi-criteria sort I might not have thought of it before, I 
guess because you usually don't have many criteria. But now this made me think 
we can take even more advantage of the existing tuple_elem_compare.

I the context of multi-criteria sort I might not have thought of it before, I 
guess because you usually don't have many criteria. But now the optimized 
tuple_elem_compare makes me think we can take even more advantage of it.

I think those type-specific optimized comparison functions are what I left out 
when I previously read the sort, that's why it was new to me. I just saw you 
also use powersort's merge strategy now. Kinda sad, I had seen you lament that 
your own strategy "remains hard to grasp why it's always correct now", while I 
think it's rather straightforward and had considered adding a little 
explanation in the doc.

Bucket sort is a name I considered, but I wrote two, so named them after their 
implementation (groupsort first used itertools.groupby).

--

___
Python tracker 

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



[issue20749] shutil.unpack_archive(): security concerns not documented

2021-10-22 Thread swenson


Change by swenson :


--
keywords: +patch
nosy: +swenson
nosy_count: 3.0 -> 4.0
pull_requests: +27458
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29184

___
Python tracker 

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



[issue45584] Clarifying truncating in documentation

2021-10-22 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +27457
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29183

___
Python tracker 

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



[issue45584] Clarifying truncating in documentation

2021-10-22 Thread Arthur Milchior


New submission from Arthur Milchior :

While floor/ceil 's documentation are very precise, `truncate` was not 
explained. I actually had to search online to understand the difference between 
`truncate` and `floor` (admittedly, once I remembered that numbers are signed, 
and that floating numbers actually uses a bit for negation symbol instead of 
two complement, it became obvious)

I assume that I won't be the only user having this trouble, especially for 
people whose mother tongue is not English. So I suggest adding a clarification 
to help make what should be obvious to most actually explicit

--
assignee: docs@python
components: Documentation
messages: 404850
nosy: ArthurMilchior, docs@python
priority: normal
severity: normal
status: open
title: Clarifying truncating in documentation
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 
3.9

___
Python tracker 

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



[issue45530] Improve listobject.c's unsafe_tuple_compare()

2021-10-22 Thread Tim Peters


Tim Peters  added the comment:

Stefan, thanks - I think I understand what you're driving at now.

You're (re)discovering that sorting by lexicographic ordering rules is 
_inherently_ suboptimal if list elements can only be compared "starting at 
index 0" each time. Not just tuples, but also, e.g., lists, byte arrays, and 
even strings. Any sequence type whose ordering derives from lexicographic 
generalization of its elements' ordering.

This is quite independent of whether or not CPython tries to exploit type 
homogeneity.

The usual(*) solution is indeed to exploit a kind of bucket sort instead, first 
sorting at elements' index 0 alone, saying all those elements with the same 
value at index 0 constitute "a bucket", and then applying the same idea to each 
bucket but sorting on index 1 instead. Where those in turn are partitioned into 
buckets equal at index 1, and those buckets are similarly each sorted on index 
2. And so on, and so on.

No doubt that can be a big win, and even in the absence of the type homogeneity 
tricks. It's far beyond the scope of _this_ PR, though, and is really an 
entirely different approach.

I've thought about it at times, but it's "a real project" to do it right. In 
effect, it would implement an optimized generalization of the SO OP's 
"automagically convert multikey to multisort" wish.

Fine by me if someone pursues that, but I don't have the energy for it, nor 
much interest either in doing a half-hearted job of it.

I always expected that if it came up at all, it would be in the context of 
sorting lists of strings.  For example, consider:

xs = ['x' * 10_000 + str(i) for i in range(1_000_000)]
random.shuffle(xs)

Even with type homogeneity tricks, Python's sorting of the result is very far 
from optimal. Every single comparison starts by burning time skipping over the 
(at least) ten thousands equal characters at the start.

The "bucket sort" (or it could be viewed as a form of MSD radix sort) quickly 
discovers that all the characters at index 0 are equal, and also all those at 
index 1, ..., and all those at index . The "real work" of sorting is then 
reduced to working on the (at most) 6 characters remaining.

(*) But I'm lying ;-) The actual usual solution is to use "multikey quicksort", 
because it's easy to code and works "in place". But it's not a stable sort. 
String sorting doesn't care about that, but sorting other kinds of sequences 
can care a lot.

--

___
Python tracker 

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



[issue45583] Documentation of int() in datamodel.rst is out of date

2021-10-22 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 2.0 -> 3.0
pull_requests: +27456
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29182

___
Python tracker 

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



[issue45583] Documentation of int() in datamodel.rst is out of date

2021-10-22 Thread Arthur Milchior


New submission from Arthur Milchior :

In 3.8, int() default implementation changed, using __index__() if it is 
available instead of __trunc__(). The file function.rst was updated 
accordingly, but the redundant information in datamodel.rst contained out of 
date information

I offer a correction in https://github.com/python/cpython/pull/29182 (but 
ideally it should be added back to 3.8 python documentation)

--
assignee: docs@python
components: Documentation
messages: 404848
nosy: ArthurMilchior, docs@python
priority: normal
severity: normal
status: open
title: Documentation of int() in datamodel.rst is out of date
versions: Python 3.8

___
Python tracker 

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



[issue45305] Unexpected record of call_args_list when passing mutable object to mock.patch

2021-10-22 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

This issue also came up with MagicMock on stackoverflow: 
https://stackoverflow.com/questions/23257227/python-mock-method-call-arguments-display-the-last-state-of-a-list/23264042

Dave: glad this helped to clear it up. For the record, the arguments in Python 
are passed by object reference, which is not the same as by reference or by 
value; - it means that mutable objects can be mutated by receiving func and 
immutable objs cannot be mutated. In your case it was a mutable object, you 
mutated it, but compared it to value that it had before mutation.

I've thought if this should be cleared up in the docs, but I think in most 
cases it will be fairly obvious to see what happened because the tested value 
will differ from expected exactly in the way that the function modifies it. But 
if more people run into this confusion, we should consider adding a note to 
MagicMock, call_args, and call_args_list (and maybe some other mock attrs).

--
stage:  -> resolved
status: open -> closed
title: Incorrect record of call_args_list when using multiple side_effect in 
mock.patch -> Unexpected record of call_args_list when passing mutable object 
to mock.patch
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.7

___
Python tracker 

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



[issue45566] dataclasses’s `test_frozen_pickle` does not use all possible `pickle` protocols

2021-10-22 Thread Eric V. Smith

Change by Eric V. Smith :


--
title: dataclasses `test_frozen_pickle` does not use all possible `pickle` 
protocols -> dataclasses’s `test_frozen_pickle` does not use all possible 
`pickle` protocols

___
Python tracker 

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



[issue45566] dataclasses `test_frozen_pickle` does not use all possible `pickle` protocols

2021-10-22 Thread Eric V. Smith


Change by Eric V. Smith :


--
title: `test_frozen_pickle` does not use all possible `pickle` protocols -> 
dataclasses `test_frozen_pickle` does not use all possible `pickle` protocols

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-10-22 Thread Brett Cannon


Change by Brett Cannon :


--
pull_requests: +27455
pull_request: https://github.com/python/cpython/pull/29181

___
Python tracker 

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



[issue45379] Improve errors related to frozen modules.

2021-10-22 Thread Filipe Laíns

Change by Filipe Laíns :


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

___
Python tracker 

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



[issue45531] field "mro" behaves strangely in dataclass

2021-10-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

The problem is that dataclasses is looking for a default value for a field by 
looking at getattr(cls, fieldname), which returns a value when fieldname is 
"mro".

I think the best thing to do, at least for now, is prohibit a field named "mro".

Ultimately I'd like to see cls.mro go away (maybe being replaced by a builtin), 
but I realize that's not likely to happen.

--

___
Python tracker 

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



[issue45379] Improve errors related to frozen modules.

2021-10-22 Thread Filipe Laíns

Filipe Laíns  added the comment:

I was looking at the code and it seems PyImport_ImportFrozenModuleObject does 
not set an error on FROZEN_BAD_NAME, it just returns 0, is this intended? If I 
pass a bogus object, it will just return 0.
This does not seem right.

Currently, FROZEN_BAD_NAME is never passed to set_frozen_error.

--

___
Python tracker 

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



[issue16889] facilitate log output starting at beginning of line

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

Reproduced on 3.11.

--
nosy: +iritkatriel
versions: +Python 3.11 -Python 3.4

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-10-22 Thread Steve Dower


Steve Dower  added the comment:

The PR has more work to do, but the overall layout/changes are more or less 
there, so happy to discuss feedback/etc.

Obviously there are a lot of edge cases here, but they seem to be mostly tested 
already. And I think we're early enough in alpha to find any major issues (or 
absorb any necessary minor changes - seems like trailing slashes might change 
on some paths).

There are also some changes/hacks into the new frozen module support, so that I 
can freeze getpath.py without turning it into a module. I really just want to 
execute the bytecode - no reason for any of its contents to stick around - and 
this works out pretty neatly. But if the changes to frozen modules seem off 
then maybe we can split it into totally separate freezing support?

--

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-10-22 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +27453
pull_request: https://github.com/python/cpython/pull/29179

___
Python tracker 

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



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

2021-10-22 Thread Eric Snow


Eric Snow  added the comment:

Thanks for bringing this up, Greg!

--

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-10-22 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue45582] Rewrite getpath.c in Python

2021-10-22 Thread Steve Dower


New submission from Steve Dower :

As discussed in issue42260, combining the two getpath implementations into a 
single Python implementation would make it more maintainable and modifiable 
(particularly where distros need to patch to support alternative layouts).

--
assignee: steve.dower
components: Interpreter Core
messages: 404841
nosy: eric.snow, ncoghlan, steve.dower, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Rewrite getpath.c in Python
type: enhancement
versions: Python 3.11

___
Python tracker 

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



[issue45305] Incorrect record of call_args_list when using multiple side_effect in mock.patch

2021-10-22 Thread Dave McNulla


Dave McNulla  added the comment:

I understand. It's a thing I often forget in python that some parameters are 
passed by value while others are passed by reference (language for parameters I 
remember from C class about 30 years ago).

I do not think I would have caught that with docs, unless you start putting 
them in Stack Overflow! I'm only sort of kidding.

I think you can close this bug.

Thanks for the clarification,

Dave

--
resolution:  -> not a bug

___
Python tracker 

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



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

2021-10-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

i'm considering this fixed based on my testing.  we still lack buildbots using 
out of tree setup.  i'll ponder that.  But this issue need not track that 
infrastructure.

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



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

2021-10-22 Thread Eric Snow


Eric Snow  added the comment:


New changeset 17c61045c51512add61a9e75e9c7343cf4e4fb82 by Eric Snow in branch 
'main':
bpo-45506: Normalize _PyPathConfig.stdlib_dir when calculated. (#29040)
https://github.com/python/cpython/commit/17c61045c51512add61a9e75e9c7343cf4e4fb82


--

___
Python tracker 

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



[issue45292] Implement PEP 654: Exception Groups

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset f30ad65dbf3c6b1b5eec14dc954d65ef32327857 by Irit Katriel in 
branch 'main':
bpo-45292: [PEP 654] add the ExceptionGroup and BaseExceptionGroup classes 
(GH-28569)
https://github.com/python/cpython/commit/f30ad65dbf3c6b1b5eec14dc954d65ef32327857


--

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27451
pull_request: https://github.com/python/cpython/pull/29178

___
Python tracker 

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



[issue45477] configure script cannot detect float word ordering on linux

2021-10-22 Thread Sourish Basu


Sourish Basu  added the comment:

By enabling and disabling optimization flags one by one, I figured out it was 
'-ipo' (inter-procedural optimization) that was the problem. Without that flag, 
'configure' is successful. However, now I have a 'make' error:

./Programs/_testembed.c(1774): error: "__builtin_types_compatible_p" is only 
allowed in C
  config_set_argv(, Py_ARRAY_LENGTH(argv), argv);
   ^

compilation aborted for ./Programs/_testembed.c (code 2)
make[3]: *** [Programs/_testembed.o] Error 2

--

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-10-22 Thread Brett Cannon


Change by Brett Cannon :


--
pull_requests: +27450
pull_request: https://github.com/python/cpython/pull/29177

___
Python tracker 

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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg


Change by Marc-Andre Lemburg :


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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Turns out this was a bug in the freeze.py script I was using. I had added a bug 
work-around for the modulefinder module and even though it should work as 
advertised, it seems to be missing some code object attributes when recreating 
the objects which fixed file paths.

The stdlib version uses the .replace() method which was added in Python 3.8 and 
that appears to work better.

Is it possible that code objects now have some extra attributes in 3.10 which 
aren't exposed ? E.g. things placed into ce_extras ?

--

___
Python tracker 

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



[issue45579] [list.append(i) for i in list] causes high resources usage

2021-10-22 Thread Spencer Brown


Spencer Brown  added the comment:

This is intentional behaviour, you actually created an infinite loop. When you 
iterate over a list, all Python does is track the current index through the 
list internally, incrementing it each time. But each iteration, you call 
list.append() to add a new item to the end of the list, so you're continually 
making it longer and preventing the iteration from ending.

Regardless of that, this probably isn't a good use of list comprehensions 
anyway - append() always returns None, so the result of this comprehension 
would be a useless list of Nones. It'd be better to just use a regular for 
loop, or if you're just wanting to copy the list call list.copy() or 
list(your_list).

--
nosy: +Spencer Brown

___
Python tracker 

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



[issue45574] Warning: ‘print_escape’ defined but not used

2021-10-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27449
pull_request: https://github.com/python/cpython/pull/29176

___
Python tracker 

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



[issue45574] Warning: ‘print_escape’ defined but not used

2021-10-22 Thread miss-islington


miss-islington  added the comment:


New changeset 4bc5473a42c5eae0928430930b897209492e849d by Nikita Sobolev in 
branch 'main':
bpo-45574: fix warning about `print_escape` being unused (GH-29172)
https://github.com/python/cpython/commit/4bc5473a42c5eae0928430930b897209492e849d


--
nosy: +miss-islington

___
Python tracker 

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



[issue14170] print unicode string error in win8 cmd console

2021-10-22 Thread Tim Golden


Tim Golden  added the comment:

Closing this as out-of-date. The original bug was reported against 2.7 and 
Win8, both of which are either end-of-life now.

No follow up in 9 years and I'm quite certain that modern Pythons handle all 
manner of Unicode chars on the console.

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

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-22 Thread miss-islington


miss-islington  added the comment:


New changeset f812fef2f8f12441ce559335645433c8124e7db5 by Miss Islington (bot) 
in branch '3.10':
bpo-30570: Use Py_EnterRecursiveCall() in issubclass() (GH-29048)
https://github.com/python/cpython/commit/f812fef2f8f12441ce559335645433c8124e7db5


--

___
Python tracker 

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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

I've looked at how the importlib freeze logic works, compared to 
Tools/freeze/freeze.py.

The only difference I can spot is that importlib uses C to build the C array 
and does a compile followed by a marshal.dumps, whereas freeze.py loads all 
modules into memory and then runs marshal on module.__code__.

Could this cause issues with the line number calculations in 3.10 ?

--

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-22 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset 423fa1c1817abfa8c3d1bc308ddbbd8f28b69d68 by Dennis Sweeney in 
branch 'main':
bpo-30570: Use Py_EnterRecursiveCall() in issubclass() (GH-29048)
https://github.com/python/cpython/commit/423fa1c1817abfa8c3d1bc308ddbbd8f28b69d68


--

___
Python tracker 

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



[issue30570] issubclass segfaults on objects with weird __getattr__

2021-10-22 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 10.0 -> 11.0
pull_requests: +27448
pull_request: https://github.com/python/cpython/pull/29175

___
Python tracker 

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



[issue45305] Incorrect record of call_args_list when using multiple side_effect in mock.patch

2021-10-22 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
nosy: +kj

___
Python tracker 

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



[issue45305] Incorrect record of call_args_list when using multiple side_effect in mock.patch

2021-10-22 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Dave: what seems to happen here is that mock correctly reporting to you that 
the object you passed to the mocked func is currently `{}`. What you probably 
expected it to be is to be equal to what it was at exact time when it was 
passed, i.e. before it was modified inside the method.

That's a reasonable expectation but it means it would have to be deepcopied, 
which could be expensive for large structures.

Do you think that noting this nuance in the docs for call_list_args would have 
helped you debug it in this case?

--
nosy: +andrei.avk

___
Python tracker 

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



[issue44665] asyncio.create_task() documentation should mention user needs to keep reference to the task

2021-10-22 Thread Vincent Bernat


Vincent Bernat  added the comment:

Hummm, I have a hard time finding a short example when `__del__` is not called 
until the task is finished. Sorry. I did run into this several time, for 
example here: https://github.com/ldo/dbussy/pull/45 (and some internal projects 
as well). So, it happens from time to time, but it is hard to find a simple 
reproducer.

--

___
Python tracker 

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



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

2021-10-22 Thread Filipe Laíns

Change by Filipe Laíns :


--
pull_requests: +27447
pull_request: https://github.com/python/cpython/pull/29174

___
Python tracker 

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



[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2021-10-22 Thread Richard van den Berg


Richard van den Berg  added the comment:

In that case Stijn Hope should create the PR since he wrote the patch. Anyone 
else could get in trouble for using his code without proper permission.

--

___
Python tracker 

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



[issue40051] Give proper link in help(idlelib/turtledemo/tkinter.sub/test_*/?)

2021-10-22 Thread Éric Araujo

Éric Araujo  added the comment:

Option 3 seems simple and ok to me.

--
nosy: +eric.araujo

___
Python tracker 

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



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

2021-10-22 Thread Filipe Laíns

Change by Filipe Laíns :


--
pull_requests: +27446
pull_request: https://github.com/python/cpython/pull/29173

___
Python tracker 

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



[issue45531] field "mro" behaves strangely in dataclass

2021-10-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Where does dataclasses call mro()?

--

___
Python tracker 

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



[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Nikita Sobolev


Nikita Sobolev  added the comment:

I completelly agree that the exable above is out of scope. Because it requires 
`locals()` to be modified. While this issue is focused on `globals()`.

--

___
Python tracker 

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



[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Alex Waygood


Alex Waygood  added the comment:

@Sergei, I believe that's a much larger issue, and one that's quite difficult 
to solve. It's one of the principal reasons why `from __future__ import 
annotations` behaviour wasn't made the default in Python 3.10, as was 
originally the plan. (This behaviour doesn't play nicely with libraries such as 
pydantic that analyse annotations at runtime.) I think it's probably beyond the 
scope of this BPO issue :)

https://mail.python.org/archives/list/python-...@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/

--

___
Python tracker 

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



[issue45530] Improve listobject.c's unsafe_tuple_compare()

2021-10-22 Thread Stefan Pochmann


Stefan Pochmann  added the comment:

> It's not surprising the 2nd positions are rarely equal _given_ that the 
> universe has been reduced to the 100 tuples with the same first element.

Yes, exactly.

> In any case, I don't see the point to this exercise ;-)

Just to illustrate why I disagree with what I responded to there. I'm not 
convinced that many matches at the first tuple position are really an 
indication that there'll be many matches at the second position as well, so 
that one should "admit defeat" and that it's "arrogance" to hope for only few 
matches at the second position. I'd wager it's rather typical that the matching 
rate at the second position is significantly lower. If you sort people by last 
and then first name, I think you'd get the same effect as with my above random 
example, for the same reason. If you sort a set of 2D coordinates, you'll even 
*never* get matches at the second position. Even with that SO question's data 
and its massive duplication (especially at the second position) *and* its 
correlation between first and second position (since both "sorted(x)" and 
"x[::2]" are derived from the same x) and its 43% matching rate at the first 
position, there's still only 27% matching rate at the second position (lower tha
 n the 1/3 break-even point).

> BTW, don't overlook that tuple_elem_compare can _only_ be used on the very 
> first elements of the tuples.

Yes, that's why I only talked about PyObject_RichCompareBool there.

> > 1) Sort the list only by first position (comparing with only
> >one tuple_elem_compare).

> Not sure what that means, exactly. (the "with only one tuple_elem_compare" 
> part;

Just wanted to make clear it wouldn't used two tuple_elem_compare or a 
PyObject_RichCompareBool.

> > 2) Identify equal-first-position-runs (with tuple_elem_compare)
> > and sort each run independently (comparing only positions 1+).

> What are you aiming at? There was no motivation given here.

Much fewer comparisons, especially PyObject_RichCompareBool comparisons. For 
example for sorting a million pairs with first/second element chosen from a 
population of 100,000, I get these numbers of comparisons (per element):

current  groupsort
--
== first 18.60  none(PyObject_RichCompareBool)
 < first 16.19 19.60(tuple_elem_compare)
== second 2.41  2.36(PyObject_RichCompareBool)
 < second 2.41  2.36(PyObject_RichCompareBool)
--
total slow   23.42  4.72(PyObject_RichCompareBool)
total fast   16.19 19.60(tuple_elem_compare)
--
total39.61 24.32

(With "current" I mean before your optimizations, which I can't test yet.)

> Will, this issue report is about unsafe_tuple_compare(), so, ya, if the 
> changes you envision aren't limited to that, I'd say you want to open a 
> different issue report and a different PR :-)

Ok, I might try that.

--

___
Python tracker 

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



[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2021-10-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

New failure today: 
https://github.com/python/cpython/runs/3979900415?check_suite_focus=true


test_sendfile_close_peer_in_the_middle_of_receiving 
(test.test_asyncio.test_sendfile.SelectEventLoopTests) ... ok

==
FAIL: test_sendfile_close_peer_in_the_middle_of_receiving 
(test.test_asyncio.test_sendfile.ProactorEventLoopTests)
--
Traceback (most recent call last):
  File "D:\a\cpython\cpython\lib\test\test_asyncio\test_sendfile.py", line 457, 
in test_sendfile_close_peer_in_the_middle_of_receiving
with self.assertRaises(ConnectionError):

AssertionError: ConnectionError not raised

--

___
Python tracker 

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



[issue45574] Warning: ‘print_escape’ defined but not used

2021-10-22 Thread Nikita Sobolev


Change by Nikita Sobolev :


--
components: +Parser
nosy: +lys.nikolaou, pablogsal
type:  -> behavior
versions: +Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45574] Warning: ‘print_escape’ defined but not used

2021-10-22 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue45531] field "mro" behaves strangely in dataclass

2021-10-22 Thread Éric Araujo

Éric Araujo  added the comment:

If dataclasses wanted to allow fields named `mro`, it could replace its call to 
`cls.mro()` with `type.mro(cls)`.  But I don’t know if there is a strong use 
case for such a field.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-22 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue45518] Invalid example for typing

2021-10-22 Thread Éric Araujo

Change by Éric Araujo :


--
resolution:  -> not a bug
status: open -> pending
type: compile error -> behavior

___
Python tracker 

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



[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-22 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

Currently, we call _pysqlite_seterror() if sqlite3_open_v2() returns != 
SQLITE_OK. However, if a memory failure occurs during sqlite3_open_v2(), the 
database handle is explicitly set to NULL. This _may_ cause 
_pysqlite_seterror() to segfault, since we pass it a NULL db pointer, because 
behaviour is undefined if we pass sqlite3_errmsg() a NULL pointer.


See also:
- https://sqlite.org/c3ref/open.html

--
assignee: erlendaasland
components: Extension Modules
messages: 404818
nosy: erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are

2021-10-22 Thread Brett Cannon


Brett Cannon  added the comment:

I also need to leave a comment on 
https://github.com/python/typeshed/issues/6030 if/when this is fixed.

--

___
Python tracker 

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



[issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are

2021-10-22 Thread Brett Cannon


Brett Cannon  added the comment:

> One thing I would strongly suggest for consistent terminology: Make 
> "iterator" mean an object that has both "__next()__" and "__iter()__".

The point of this issue, though, is to not make that claim as it's inaccurate.

--
stage: patch review -> 

___
Python tracker 

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



[issue45250] Make sure documentation is accurate for what an (async) iterable and (async) iterator are

2021-10-22 Thread Brett Cannon


Change by Brett Cannon :


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

___
Python tracker 

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



[issue45580] argparse.ArgumentParser.add_mutually_exclusive_group : metavar create parenthesis undefined behavior

2021-10-22 Thread AbcSxyZ

New submission from AbcSxyZ :

Hi,

I'm getting a kind of undefined behavior where parenthesis seem handled in a 
strange way. On display, it has a conflict between parenthesis of the option, 
and nested parenthesis within a metavar.

## Reproduction script

```
import argparse

def main():
parser = argparse.ArgumentParser()

group = parser.add_mutually_exclusive_group(required=True)

group.add_argument("-p", "--path", metavar="/var/www/html", 
help="DocumentRoot path")
group.add_argument("-r", "--reverse", metavar="http)s(://Host:Port",
help="Reverse proxy address")

parser.add_argument("--last-args")
return parser.parse_args()

main()
```

## Output of help menu
```
usage: crash.py [-h] (-p /var/www/html | -r http)s://Host:Port [--last-args 
LAST_ARGS]
```

## Expected behavior
```
usage: crash.py [-h] (-p /var/www/html | -r http)s(://Host:Port) [--last-args 
LAST_ARGS]
```

--
components: Parser
messages: 404815
nosy: AbcSxyZ, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: argparse.ArgumentParser.add_mutually_exclusive_group : metavar create 
parenthesis undefined 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



[issue45571] Modules/makesetup uses wrong CFLAGS for *shared*

2021-10-22 Thread Christian Heimes


Change by Christian Heimes :


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



[issue34958] urllib.error.HTTPError.fp is not closed when error is finalized on Windows

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.4, Python 3.5, Python 
3.6, Python 3.7

___
Python tracker 

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



[issue24151] test_pydoc fails

2021-10-22 Thread Ned Deily


Change by Ned Deily :


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

___
Python tracker 

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



[issue40210] ttk.Combobox focus-out event inheritage

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as there is not enough information to understand the issue and there 
was not response to followup questions.

--
nosy: +iritkatriel
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue45579] [list.append(i) for i in list] causes high resources usage

2021-10-22 Thread TL

New submission from TL :

Version:
Python 3.10.0 - Windows 11 (22000.258) x64
Python 3.9.7 - Windows 11, Manjaro Linux 21.1.5 - Kernel 5.13.13-1-MANJARO x64
CPU: 8 × Intel® Core™ i5-8300H CPU @ 2.30GHz

Steps to reproduce:
1. Create any list, for example your_list = [1, 2, 3]
2. Execute [your_list.append(i) for i in your_list]

--
components: Interpreter Core
messages: 404813
nosy: txlbr
priority: normal
severity: normal
status: open
title: [list.append(i) for i in list] causes high resources usage
type: resource usage
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue45524] Cross-module dataclass inheritance breaks get_type_hints

2021-10-22 Thread Sergei Lebedev


Sergei Lebedev  added the comment:

Is it worth also addressing the case where a @dataclass/typing.TypeDict class 
is defined within a function?

``` 
 
from __future__ import annotations

import typing
from dataclasses import dataclass


def make_A():
  import collections

  @dataclass
  class A:
x: collections.defaultdict

  return A


A = make_A()

@dataclass
class B(A):
  y: int

# NameError: name 'collections' is not defined
print(typing.get_type_hints(B.__init__))
```

--

___
Python tracker 

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



[issue45571] Modules/makesetup uses wrong CFLAGS for *shared*

2021-10-22 Thread miss-islington


miss-islington  added the comment:


New changeset 269bf56e3d352c415ec38f93017ba8e291ddb18a by Miss Islington (bot) 
in branch '3.9':
bpo-45571: use PY_CFLAGS_NODIST for shared Modules/Setup (GH-29161)
https://github.com/python/cpython/commit/269bf56e3d352c415ec38f93017ba8e291ddb18a


--

___
Python tracker 

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



[issue45578] Missing tests for the dis module

2021-10-22 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

It looks like it actually

--

___
Python tracker 

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



[issue45578] Missing tests for the dis module

2021-10-22 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

maybe the latter is not a public function.

--

___
Python tracker 

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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

I see this in modules frozen by the Tools/freeze/ tool.

The line numbers shown for such frozen modules in the frameinfo stack are a bit 
off as well, compared normal Python. Could this be an indication that there's 
something not working quite right, which then leads to 
_PyCode_CheckLineNumber() returning -1 ?

The Tools/freeze/ doesn't do anything special, BTW. All it does is load the 
module and then store the marshal'ed code objects in C arrays. The information 
read from those C arrays should be the same as what Python reads from PYC files.

--

___
Python tracker 

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



[issue45571] Modules/makesetup uses wrong CFLAGS for *shared*

2021-10-22 Thread miss-islington


miss-islington  added the comment:


New changeset 19903085c3ad7a17c8047e1556c700f2eb109931 by Miss Islington (bot) 
in branch '3.10':
bpo-45571: use PY_CFLAGS_NODIST for shared Modules/Setup (GH-29161)
https://github.com/python/cpython/commit/19903085c3ad7a17c8047e1556c700f2eb109931


--

___
Python tracker 

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



[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:

We no longer accept patches. Contributors have to create a PR on GitHub, so we 
can record contributions and verify the contributor license agreement.

--

___
Python tracker 

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



[issue45578] Missing tests for the dis module

2021-10-22 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
title: Missing tests for he dis module -> Missing tests for the dis module

___
Python tracker 

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



[issue45578] Missing tests for he dis module

2021-10-22 Thread Joannah Nanjekye


New submission from Joannah Nanjekye :

I don't see any tests for the following:

dis.distb
dis.findlabels

They are documented, I wonder if it was intentional.

dis.findlabels is also not dicumented.

--
components: Tests
messages: 404805
nosy: nanjekyejoannah
priority: normal
severity: normal
status: open
title: Missing tests for he dis module
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



[issue41222] POpen bufsize=0 ignored with universal_newlines=True

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


--
nosy: +pitrou

___
Python tracker 

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



[issue45571] Modules/makesetup uses wrong CFLAGS for *shared*

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset f6e8b80d20159596cf641305bad3a833bedd2f4f by Christian Heimes in 
branch 'main':
bpo-45571: use PY_CFLAGS_NODIST for shared Modules/Setup (GH-29161)
https://github.com/python/cpython/commit/f6e8b80d20159596cf641305bad3a833bedd2f4f


--

___
Python tracker 

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



[issue45571] Modules/makesetup uses wrong CFLAGS for *shared*

2021-10-22 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45571] Modules/makesetup uses wrong CFLAGS for *shared*

2021-10-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +27442
pull_request: https://github.com/python/cpython/pull/29169

___
Python tracker 

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



[issue24151] test_pydoc fails

2021-10-22 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I wonder if this is worth keeping open, since it's old and no one has 
reproduced it. I propose closing or OP to share environment details.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Mark Shannon


Mark Shannon  added the comment:

If I knew where to look, I would be looking myself :)

Is the frozen module one built into CPython or one you have generated?

--

___
Python tracker 

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



[issue24666] Buffered I/O does not take file position into account when reading blocks

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


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



[issue24666] Buffered I/O does not take file position into account when reading blocks

2021-10-22 Thread STINNER Victor


STINNER Victor  added the comment:

Hi, the io module doesn't use the block size of the filesystem. 
io.BufferedReader uses a default buffer size of 8 * 1024 bytes. I don't think 
that it's really important to respect the block size in Python. There are 
buffers at many levels. io.BufferedReader is a buffer in user space, but there 
is also a buffer in the kernel. I'm not sure how relevant is to use know that a 
"disk sector" is 4096 bytes, when most people use SSDs which use way larger SSD 
blocks (ex: 512 KB). It's hard to say what's real block size. The disk firmware 
can lie (pretend it's 4 KiB) or the kernel can lie. The disk firmware can 
emulate different "block sizes".

If you write a database, maybe you would like to start caring about that, but 
you may want to use direct I/O (O_DIRECT) flag for that.

In short, Python works as expect, it's efficient and you should not worry about 
that ;-)

--
nosy: +vstinner

___
Python tracker 

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



[issue45563] inspect.getframeinfo() doesn't handle frames without lineno

2021-10-22 Thread Marc-Andre Lemburg


Marc-Andre Lemburg  added the comment:

Update: I've been trying hard to find a short version which triggers the issue, 
but so far it seems to only trigger when using exec() from a frozen Python 
module.

There don't appear to be many ways frame->f_lineno can end up being -1 (which 
then gets translated into None in Python). _PyCode_CheckLineNumber() is one 
source I found.

Any hints where to look for the cause of this weird effect ?

--

___
Python tracker 

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



[issue45487] SSLEOFError regression with certain servers in Python 3.10

2021-10-22 Thread Richard

Richard  added the comment:

Never mind, I found the root cause after some debugging. Adding 
AES256-GCM-SHA384 to the cipher string resolved the issue.

And now I see that the release notes say this:

> The ssl module now has more secure default settings. Ciphers without forward 
> secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits weak 
> RSA, DH, and ECC keys with less than 112 bits of security. SSLContext 
> defaults to minimum protocol version TLS 1.2. Settings are based on Hynek 
> Schlawack’s research. (Contributed by Christian Heimes in bpo-43998.)

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



[issue39838] Possible unnecessary redifinition of _POSIX_C_SOURCE

2021-10-22 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

Closing this, someone else can reopen if they see the same.

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



[issue22678] An OSError subclass for "no space left on device" would be nice: NoSpaceError

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

Shall we conclude from 7 years of no activity that there isn't much interest in 
this exception?

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

___
Python tracker 

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



[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2021-10-22 Thread Richard van den Berg


Richard van den Berg  added the comment:

Here is the updated patch. Is python5004-test.c enough as a test case?

--
Added file: https://bugs.python.org/file50390/python2.7-socket-getfqdn.patch

___
Python tracker 

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



[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-22 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> My understanding is that this entire class of code changes has been put on 
> hold pending Steering Council approval.

Can you please point me to the official SC statement regarding this? I cannot 
find it.

> It represents a great deal of code churn and creation on new APIs.

You cannot implement [the accepted] PEP 630 without a little bit of code churn 
;) Luckily, (most of) the APIs needed are defined in PEP 573 (also accepted, 
now in final state).

> Several of the patches had had negative performance impacts [...]

Can you provide a list of the patches/bpo's with still unresolved performance 
impacts?

> [...] all of the patches have made the code more complicated and harder to 
> maintain

I have not seen other complaints about this? Can you provide a link to a bpo or 
a Discourse topic? If you find the new APIs hard to use or understand, we can 
of course improve the documentation and the dev guide :)

> Several that I looked at had no tests at all [...]

Actually, we've added tests to heap types with Py_TPFLAGS_IMMUTABLE_TYPE and 
Py_TPFLAGS_DISALLOW_INSTANTIATION. Apart from that; if a type lives on the 
stack or on the heap should be transparent for the user, right? The existing 
test suite will help verify exactly that.

> [...] so there was no discernible or provabler user benefit.

The benefits are described in PEP 630 ;)

> IIRC one or more of the patches created new bugs, were destabilizing, or 
> altered the APIs in subtle ways.

There has been cases with ref-leaks, but that happens from time to time in all 
types of PRs, not just heap type PRs. Those have all been caught and fixed, 
thanks to reviewers and ref-leak-bots.

I'm not sure what you mean with 'destabilizing'? Can you point to a specific 
example or issue?

Regarding APIs, there was a long discussion about immutability and disallowing 
instantiation during the 3.10 beta period. Those issues were fixed and 
unblocked.

> Please get explicit approval from the SC before continuing to sweep through 
> the code base, creating heap types everywhere.

Strictly speaking, the fact that PEP 630 is accepted and active _is_ an 
explicit approval. It has not been withdrawn or rejected.

> Given that some essential third party modules are not going down this path 
> [...]

Which ones? Can you provide a link?

> [...] it is unlikely that general users would ever see any benefit.

The benefits are explained in PEP 630. It is a well written PEP; I suggest you 
re-read it :)

--

___
Python tracker 

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



[issue45577] Make `test_zoneinfo.py` to check all pickle protocols

2021-10-22 Thread Nikita Sobolev


Change by Nikita Sobolev :


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

___
Python tracker 

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



[issue45569] Drop support for 15-bit PyLong digits?

2021-10-22 Thread Tim Peters


Tim Peters  added the comment:

+1 "in theory". But I too don't know whether any platforms would be adversely 
affected, or how to find out :-(

--
nosy: +tim.peters

___
Python tracker 

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



[issue45577] Make `test_zoneinfo.py` to check all pickle protocols

2021-10-22 Thread Nikita Sobolev


New submission from Nikita Sobolev :

Right now it only uses a default one.

Examples:
- `3.9`: 
https://github.com/python/cpython/blob/aa8c3446c085175e65e736b0d2e32719c4d2/Lib/test/test_zoneinfo/test_zoneinfo.py#L1407
- `3.10`: 
https://github.com/python/cpython/blob/ae78ffdc9399802621eabcd1668e44a91ec5f45e/Lib/test/test_zoneinfo/test_zoneinfo.py#L1407
- `main`: 
https://github.com/python/cpython/blob/ec93721e0066c4cbe40085188a9bf0952aa935ef/Lib/test/test_zoneinfo/test_zoneinfo.py#L1405

PR is on its way!

--
components: Tests
messages: 404793
nosy: sobolevn
priority: normal
severity: normal
status: open
title: Make `test_zoneinfo.py` to check all pickle protocols
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45576] Cannot import modules from Zip64 files

2021-10-22 Thread Luis Franca


New submission from Luis Franca :

I've tried to import a module from a fat jar file and got a 
ModuleNotFoundError: No module named ... error.

I checked that the jar file had more than 65k files and was created using 
Zip64. When I unzip the file, Python is capable of importing the modules.

I was able to reproduce the error on a simple project, such as:

simplePackage/
  __init__.py
  a/
__init__.py
moduleA.py

where

- I'm using Python 3.9.4
- __init__.py files are empty
- moduleA.py only has a printA() function

I ran the following tests:

1. When importing from the folder, it works

python
>>> import sys
>>> sys.path.append('C:\\Users\\...\\simplePackage')
>>> from a.moduleA import printA
>>> printA()
I'm module a

2. When zipping the folder, it works

python
>>> import sys
>>> sys.path.append('C:\\Users\\...\\simplePackage.zip')
>>> from a.moduleA import printA
>>> printA()
I'm module a

3. When forcing to zip with Zip64 it doesn't work

On linux: zip -fzr simple64Package.zip .

python
>>> import sys
>>> sys.path.append('C:\\Users\\...\\simple64Package.zip')
>>> from a.moduleA import printA
Traceback (most recent call last):
  File "", line 1, in 
ModuleNotFoundError: No module named 'a'

Is this an expected behavior? Am I missing something?

Thanks!

--
components: Library (Lib)
messages: 404792
nosy: lfamorim
priority: normal
severity: normal
status: open
title: Cannot import modules from Zip64 files
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



[issue20937] test_socket: buffer overflow in sock_recvmsg_guts

2021-10-22 Thread Irit Katriel


Irit Katriel  added the comment:

Please create a new issue if you're still seeing this on 3.9+.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue20937] test_socket: buffer overflow in sock_recvmsg_guts

2021-10-22 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue45548] Update Modules/Setup

2021-10-22 Thread Christian Heimes


Christian Heimes  added the comment:

I added several missing module definitions in 
https://github.com/python/cpython/pull/29164

math/cmath conflict when _math.c is included twice.

--

___
Python tracker 

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



[issue45570] Simplify setup macros for pyexpat and _elementtree

2021-10-22 Thread miss-islington


miss-islington  added the comment:


New changeset ec93721e0066c4cbe40085188a9bf0952aa935ef by Christian Heimes in 
branch 'main':
bpo-45570: Simplify setup macros for pyexpat (GH-29159)
https://github.com/python/cpython/commit/ec93721e0066c4cbe40085188a9bf0952aa935ef


--
nosy: +miss-islington

___
Python tracker 

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



[issue45570] Simplify setup macros for pyexpat and _elementtree

2021-10-22 Thread Christian Heimes


Change by Christian Heimes :


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



[issue45575] Use a more principled approach to freelists

2021-10-22 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue45575] Use a more principled approach to freelists

2021-10-22 Thread Mark Shannon


New submission from Mark Shannon :

We have multiple freelists for performance, but they are adhoc and poorly 
integrated with the underlying allocator.

Improving this should give us a decent speedup.

--
assignee: Mark.Shannon
components: Interpreter Core
messages: 404788
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Use a more principled approach to freelists
type: performance
versions: Python 3.11

___
Python tracker 

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



  1   2   3   >