[issue38063] Modify test_socket.py to use unittest test discovery

2021-09-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I has merged similar PR in issue45187. Although it required to fix some 
existing bugs first.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue10611] sys.exit() in a test causes a test run to die

2021-09-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -26829

___
Python tracker 

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



[issue10611] sys.exit() in a test causes a test run to die

2021-09-17 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka
nosy_count: 4.0 -> 5.0
pull_requests: +26829
pull_request: https://github.com/python/cpython/pull/28180

___
Python tracker 

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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread Gregory P. Smith


Change by Gregory P. Smith :


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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread miss-islington


miss-islington  added the comment:


New changeset be200c3c6e2f82db553c0e5424e4ba70caf189c3 by Miss Islington (bot) 
in branch '3.10':
bpo-45196: prevent unittest crash on address sanitizer builds (GH-28331)
https://github.com/python/cpython/commit/be200c3c6e2f82db553c0e5424e4ba70caf189c3


--

___
Python tracker 

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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread miss-islington


miss-islington  added the comment:


New changeset 9ccdc90488302b212bd3405d10dc5c22052e9b4c by Miss Islington (bot) 
in branch '3.9':
bpo-45196: prevent unittest crash on address sanitizer builds (GH-28331)
https://github.com/python/cpython/commit/9ccdc90488302b212bd3405d10dc5c22052e9b4c


--

___
Python tracker 

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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread Gregory P. Smith


Change by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26751
pull_request: https://github.com/python/cpython/pull/28338

___
Python tracker 

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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26750
pull_request: https://github.com/python/cpython/pull/28337

___
Python tracker 

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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread Gregory P. Smith


Gregory P. Smith  added the comment:


New changeset b668cdfa09e9bdfcfddaadd23dbd455d5f667383 by junyixie in branch 
'main':
bpo-45196: prevent unittest crash on address sanitizer builds (GH-28331)
https://github.com/python/cpython/commit/b668cdfa09e9bdfcfddaadd23dbd455d5f667383


--

___
Python tracker 

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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread junyixie


junyixie  added the comment:

ignore test_decimal.py crash backtrace.

--

___
Python tracker 

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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread junyixie


Change by junyixie :


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

___
Python tracker 

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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread junyixie


Change by junyixie :


--
type:  -> crash

___
Python tracker 

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



[issue45196] macOS. ./configure --with-address-sanitizer; make test; cause test case crash.

2021-09-14 Thread junyixie


New submission from junyixie :

test_io.py
```
=
==54932==ERROR: AddressSanitizer: requested allocation size 0x7fff 
(0x80001000 after adjustments for alignment, red zones etc.) exceeds 
maximum supported size of 0x100 (thread T0)
  #0 0x102f1fa6c in wrap_malloc+0x94 
(libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3fa6c)
  #1 0x102565fcc in _buffered_init bufferedio.c:730
  #2 0x10255bba4 in _io_BufferedReader___init__ bufferedio.c.h:435
  #3 0x10226c8c8 in wrap_init typeobject.c:6941
  #4 0x10216d3f8 in _PyObject_Call call.c:305
  #5 0x102387a6c in _PyEval_EvalFrameDefault ceval.c:4285
  #6 0x10237eaa8 in _PyEval_Vector ceval.c:5073
  #7 0x102396860 in call_function ceval.c:5888
  #8 0x102385444 in _PyEval_EvalFrameDefault ceval.c:4206
  #9 0x10237eaa8 in _PyEval_Vector ceval.c:5073
  #10 0x102396860 in call_function ceval.c:5888
  #11 0x102385444 in _PyEval_EvalFrameDefault ceval.c:4206
  #12 0x10237eaa8 in _PyEval_Vector ceval.c:5073
  #13 0x102172bec in method_vectorcall classobject.c:53
  #14 0x102396860 in call_function ceval.c:5888
  #15 0x1023885e4 in _PyEval_EvalFrameDefault ceval.c:4221
  #16 0x10237eaa8 in _PyEval_Vector ceval.c:5073
  #17 0x102396860 in call_function ceval.c:5888
  #18 0x102385444 in _PyEval_EvalFrameDefault ceval.c:4206
  #19 0x10237eaa8 in _PyEval_Vector ceval.c:5073
  #20 0x102172af4 in method_vectorcall classobject.c:83
  #21 0x10216d0a8 in PyVectorcall_Call call.c:255
  #22 0x102387a6c in _PyEval_EvalFrameDefault ceval.c:4285
  #23 0x10237eaa8 in _PyEval_Vector ceval.c:5073
  #24 0x10216c248 in _PyObject_FastCallDictTstate call.c:142
  #25 0x10216dc00 in _PyObject_Call_Prepend call.c:431
  #26 0x102268740 in slot_tp_call typeobject.c:7481
  #27 0x10216c5d4 in _PyObject_MakeTpCall call.c:215
  #28 0x102396b88 in call_function ceval.c
  #29 0x1023885e4 in _PyEval_EvalFrameDefault ceval.c:4221

==54932==HINT: if you don't care about these errors you may set 
allocator_may_return_null=1
SUMMARY: AddressSanitizer: allocation-size-too-big 
(libclang_rt.asan_osx_dynamic.dylib:arm64e+0x3fa6c) in wrap_malloc+0x94
==54932==ABORTING
Fatal Python error: Aborted

Current thread 0x000102e93d40 (most recent call first):
 File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 201 in handle
 File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 730 in 
assertRaises
 File "/Users/xiejunyi/github-cpython/Lib/test/test_io.py", line 1558 in 
test_constructor
 File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 549 in 
_callTestMethod
 File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 591 in run
 File "/Users/xiejunyi/github-cpython/Lib/unittest/case.py", line 650 in 
__call__
 File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 122 in run
 File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 84 in 
__call__
 File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 122 in run
 File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 84 in 
__call__
 File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 122 in run
 File "/Users/xiejunyi/github-cpython/Lib/unittest/suite.py", line 84 in 
__call__
 File "/Users/xiejunyi/github-cpython/Lib/test/support/testresult.py", line 140 
in run
 File "/Users/xiejunyi/github-cpython/Lib/test/support/__init__.py", line 990 
in _run_suite
 File "/Users/xiejunyi/github-cpython/Lib/test/support/__init__.py", line 1115 
in run_unittest
 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 
261 in _test_module
 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 
297 in _runtest_inner2
 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 
335 in _runtest_inner
 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 
215 in _runtest
 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest.py", line 
245 in runtest
 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/runtest_mp.py", line 
83 in run_tests_worker
 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/main.py", line 678 
in _main
 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/main.py", line 658 
in main
 File "/Users/xiejunyi/github-cpython/Lib/test/libregrtest/main.py", line 736 
in main
 File "/Users/xiejunyi/github-cpython/Lib/test/regrtest.py", line 43 in _main
 File "/Users/xiejunyi/github-cpython/Lib/test/regrtest.py", line 47 in 
 File "/Users/xiejunyi/github-cpython/Lib/runpy.py", line 86 in _run_code
 File "/Users/xiejunyi/github-cpython/Lib/runpy.py", line 196 in 
_run_module_as_main
```

test_d

[issue45177] Use shared test loader when possible when running test suite

2021-09-13 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

> Also, TestLoader has mutable attribute "errors". I am not sure that it is 
> good idea to share it between unrelated tests.

Noted. I'm closing this.

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



[issue45177] Use shared test loader when possible when running test suite

2021-09-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See issue45181. Most of this code is gone.

Also, TestLoader has mutable attribute "errors". I am not sure that it is good 
idea to share it between unrelated tests.

--

___
Python tracker 

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



[issue45177] Use shared test loader when possible when running test suite

2021-09-12 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


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

___
Python tracker 

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



[issue45177] Use shared test loader when possible when running test suite

2021-09-12 Thread Erlend E. Aasland


New submission from Erlend E. Aasland :

Use unittest.defaultTestLoader instead of unittest.TestLoader() when possible, 
to avoid creating unnecessary many instances.

--
components: Tests
messages: 401674
nosy: erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use shared test loader when possible when running test suite
versions: Python 3.11

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



[issue23774] Test failures when unable to write to install location

2021-09-10 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> allow the testsuite to run in the installed location

___
Python tracker 

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



[issue19113] duplicate test names in Lib/ctypes/test/test_functions.py

2021-09-08 Thread Łukasz Langa

Łukasz Langa  added the comment:

Change made in Python 3.11: duplicate test removed. Closing.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 2.7, Python 3.7, Python 3.8

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



[issue19113] duplicate test names in Lib/ctypes/test/test_functions.py

2021-09-08 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset a5610057615779ca6fc75d9e006d2fae644a94d3 by andrei kulakov in 
branch 'main':
bpo-19113: Remove unused test_errors from ctypes tests (GH-28008)
https://github.com/python/cpython/commit/a5610057615779ca6fc75d9e006d2fae644a94d3


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue27277] Test runner should try to increase stack size if it is too low

2021-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

I just pushed a change to reduce the stack memory usage when deleting a chain 
of exceptions in bpo-44348. I consider that this issue is a duplicate. If it's 
not the case, please reopen the issue.

commit fb305092a5d7894b41f122c1a1117b3abf4c567e (upstream/main, main)
Author: Victor Stinner 
Date:   Tue Sep 7 15:42:11 2021 +0200

bpo-44348: BaseException deallocator uses trashcan (GH-28190)

The deallocator function of the BaseException type now uses the
trashcan mecanism to prevent stack overflow. For example, when a
RecursionError instance is raised, it can be linked to another
RecursionError through the __context__ attribute or the __traceback__
attribute, and then a chain of exceptions is created. When the chain
is destroyed, nested deallocator function calls can crash with a
stack overflow if the chain is too long compared to the available
stack memory.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> test_exceptions.ExceptionTests.test_recursion_in_except_handler 
stack overflow on Windows debug builds

___
Python tracker 

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



[issue34262] Asyncio test fails under Win 7

2021-09-07 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> [Windows] test_asyncio: Proactor 
test_sendfile_close_peer_in_the_middle_of_receiving failure

___
Python tracker 

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



[issue34262] Asyncio test fails under Win 7

2021-09-07 Thread STINNER Victor


STINNER Victor  added the comment:

test_sendfile_close_peer_in_the_middle_of_receiving() failure is tracked by 
bpo-41682.

--

___
Python tracker 

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



[issue34262] Asyncio test fails under Win 7

2021-09-07 Thread Irit Katriel


Irit Katriel  added the comment:

Changing type since the crash was fixed under issue23919.

There remains (possibly) the failure of 
test_sendfile_close_peer_in_the_middle_of_receiving.

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

___
Python tracker 

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



[issue27277] Test runner should try to increase stack size if it is too low

2021-09-07 Thread Irit Katriel


Change by Irit Katriel :


--
components:  -Interpreter Core
nosy: +iritkatriel, serhiy.storchaka
title: Fatal Python error: Segmentation fault in test_exceptions -> Test runner 
should try to increase stack size if it is too low
type: crash -> enhancement
versions: +Python 3.11 -Python 3.6

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



[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2021-09-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are too many issues with TestResult.debug(). It does not call tearDown() 
and doCleanups() if the test is skipped, failed or raises other exception 
(including errors in cleanup). It does not support skipping decorators. It does 
not support the expectedFailure decorator. It does not work at all in 
IsolatedAsyncioTestCase.

--

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



[issue35190] doc: collections.abc.Sequence cannot be used to test whether a class provides a particular interface

2021-09-02 Thread Irit Katriel


Change by Irit Katriel :


--
keywords: +easy
title: collections.abc.Sequence cannot be used to test whether a class provides 
a particular interface (doc issue) -> doc: collections.abc.Sequence cannot be 
used to test whether a class provides a particular interface
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 3.6, Python 3.7, Python 
3.8

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



[issue44895] refleak test failure in test_exceptions

2021-09-01 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file50251/strict_refleak_check.patch

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-09-01 Thread Irit Katriel


Irit Katriel  added the comment:

I changed it to 

+for i in range(2):
+dash_R_cleanup(fs, ps, pic, zdc, abcs)
+support.gc_collect()


(loop twice instead of 3 times) and that seems fine too.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-09-01 Thread STINNER Victor


STINNER Victor  added the comment:

> (once I remove the @skip on test_no_hang_on_context_chain_cycle2). 

Oh. I forgot that the test is still skipped!


> With your patch I don't see a leak for refleak.py, but I still see one for 
> ./python.exe -m test -R 3:3 test_exceptions -m 
> test_no_hang_on_context_chain_cycle2 -m 
> test_recursion_normalizing_infinite_exception -m 
> test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory 
> -F -j1

If I apply attached strict_refleak_check.patch and I remove @unittest.skip("See 
issue 44895") of test_no_hang_on_context_chain_cycle2(), I get:

$ ./python -m test -R 3:3 test_exceptions -m 
test_no_hang_on_context_chain_cycle2 -m 
test_recursion_normalizing_infinite_exception -m 
test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory

(...)
test_exceptions leaked [6, -6, 6] references, sum=6
(...)

--

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



[issue44895] refleak test failure in test_exceptions

2021-09-01 Thread Irit Katriel


Irit Katriel  added the comment:

With your patch I don't see a leak for refleak.py, but I still see one for 

./python.exe -m test -R 3:3 test_exceptions -m 
test_no_hang_on_context_chain_cycle2 -m 
test_recursion_normalizing_infinite_exception -m 
test_recursion_in_except_handler -m test_recursion_normalizing_with_no_memory 
-F -j1

(once I remove the @skip on test_no_hang_on_context_chain_cycle2). 


However, if I make this change it looks better:


--- a/Lib/test/libregrtest/refleak.py
+++ b/Lib/test/libregrtest/refleak.py
@@ -90,8 +90,9 @@ def get_pooled_int(value):
 for i in rep_range:
 test_func()
 
-dash_R_cleanup(fs, ps, pic, zdc, abcs)
-support.gc_collect()
+for i in range(3):
+dash_R_cleanup(fs, ps, pic, zdc, abcs)
+support.gc_collect()

--

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



[issue44895] refleak test failure in test_exceptions

2021-09-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 679cb4781ea370c3b3ce40d3334dc404d7e9d92b by Victor Stinner in 
branch 'main':
bpo-44895: libregrtest: refleak check clears types later (GH-28113)
https://github.com/python/cpython/commit/679cb4781ea370c3b3ce40d3334dc404d7e9d92b


--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-09-01 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +26554
pull_request: https://github.com/python/cpython/pull/28113

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-09-01 Thread STINNER Victor


STINNER Victor  added the comment:

>  I changed dash_R_cleanup to put the sys._clear_type_cache() after 
> clear_caches() and the leak is gone

Aha! The order of function calls in dash_R_cleanup() matters.

Calling sys._clear_type_cache() at the end of dash_R_cleanup() perfectly makes 
sense. If you do that, please add a comment to explain that the order matters. 
For example, the code about ABC classes is likely to modify classes.

About the gc_collect() call, I dislike calling it in clear_caches() and then 
again in dash_R_cleanup(). I would even prefer to *remove* it from both 
functions and call it explicitly at the call site: in dash_R() and in 
runtest.py.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-31 Thread Irit Katriel


Irit Katriel  added the comment:

Oh, I see now what you meant. 

I think you're right that it's cleanup. I changed dash_R_cleanup to put the 
sys._clear_type_cache() after clear_caches() and the leak is gone:

@@ -166,9 +166,6 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
 zipimport._zip_directory_cache.clear()
 zipimport._zip_directory_cache.update(zdc)
 
-# clear type cache
-sys._clear_type_cache()
-
 # Clear ABC registries, restoring previously saved ABC registries.
 abs_classes = [getattr(collections.abc, a) for a in 
collections.abc.__all__]
 abs_classes = filter(isabstract, abs_classes)
@@ -181,6 +178,12 @@ def dash_R_cleanup(fs, ps, pic, zdc, abcs):
 
 clear_caches()
 
+# clear type cache
+sys._clear_type_cache()
+
+support.gc_collect()
+



I did this because I suspected it's something related to types, because it only 
happen when we define the exception classes (A and B) inside the test function. 

So maybe the type objects of these exceptions are not cleared from the type 
cache because they have refcount > 0 but by the time  clear_caches() and 
gc.collect() finish they are cleared?


Note this doesn't mean the change I made is always right - maybe the whole body 
of dash_R_cleanup should be in a loop until nothing changes?

--

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



[issue44895] refleak test failure in test_exceptions

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

> It could be a problem with the way _Py_RefTotal is incremented/decremented.

It can be a cache which is kept alive and then clear the following iteration. 
See my previous comment:

test leaked [-4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 
4] references, sum=0

libregrtest/refleak.py does its best to clear *all* caches, type caches, free 
lists, etc. A single cache which is not cleared can confused libregrtest.

--

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



[issue24981] Add a test which uses the ast module to compile the stdlib

2021-08-31 Thread Irit Katriel


Irit Katriel  added the comment:

I think there is something like this here: 

https://github.com/python/cpython/blob/22fe0eb13c3441b71b60aaea0e7fe289a29783da/Lib/test/test_ast.py#L1498

--
nosy: +iritkatriel

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



[issue44895] refleak test failure in test_exceptions

2021-08-31 Thread Irit Katriel


Irit Katriel  added the comment:

Victor - I am also getting a feeling that this may not be a real leak but 
rather a bug in the refleaks test bookkeeping. 

It could be a problem with the way _Py_RefTotal is incremented/decremented.

--

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



[issue44895] refleak test failure in test_exceptions

2021-08-31 Thread STINNER Victor


STINNER Victor  added the comment:

A variant of this problem: bpo-36560 with a leak 1 memory block per iteration.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-30 Thread Irit Katriel


Irit Katriel  added the comment:

I think the leak happens when we invoke GC while the recursion limit is 
exceeded. It goes way if make this change:


def recurse_in_body_and_except():
try:
recurse_in_body_and_except()
except RecursionError as e:
gc.disable()
recurse_in_body_and_except()
gc.enable()


I also added a __del__ to B and saw it being called when recursion limit is 
small (though adding the __del__ makes the leak go away. Actually just adding 
"def f(): pass" is enough to make it go away).

--

___
Python tracker 

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-30 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks for the report and initial patch, Iman! ✨  ✨  

And thanks Serhiy for pushing this across the finish line.

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-30 Thread miss-islington


miss-islington  added the comment:


New changeset 243b8de0b15061704581974c0a27db1232a43b93 by Miss Islington (bot) 
in branch '3.10':
bpo-41620: TestCase.run() now always return a TestResult instance (GH-28030)
https://github.com/python/cpython/commit/243b8de0b15061704581974c0a27db1232a43b93


--

___
Python tracker 

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-30 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 0c5e0aa73f6f70d16d21ad9e1eb2d0fe3a334f0a by Miss Islington (bot) 
in branch '3.9':
bpo-41620: TestCase.run() now always return a TestResult instance (GH-28030) 
(GH-28065)
https://github.com/python/cpython/commit/0c5e0aa73f6f70d16d21ad9e1eb2d0fe3a334f0a


--

___
Python tracker 

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-30 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-30 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 7e246a3a7b43762480ee4fe0cfb859e8e997a8c8 by Serhiy Storchaka in 
branch 'main':
bpo-41620: TestCase.run() now always return a TestResult instance (GH-28030)
https://github.com/python/cpython/commit/7e246a3a7b43762480ee4fe0cfb859e8e997a8c8


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26509
pull_request: https://github.com/python/cpython/pull/28065

___
Python tracker 

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



[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2021-08-29 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See issue41620 for run() returning None.

--
dependencies: +Python Unittest does not return results object when the test is 
skipped
nosy: +serhiy.storchaka

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



[issue36674] "unittest.TestCase.debug" should honour "skip" (and other test controls)

2021-08-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -14706

___
Python tracker 

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-29 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +26475
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/28030

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



[issue44998] macOS build test failure

2021-08-27 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +macOS
nosy: +ned.deily, ronaldoussoren
title: tests failed -> macOS build test failure

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



[issue19113] duplicate test names in Lib/ctypes/test/test_functions.py

2021-08-27 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
keywords: +patch
nosy: +andrei.avk
nosy_count: 8.0 -> 9.0
pull_requests: +26450
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/28008

___
Python tracker 

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-22 Thread Łukasz Langa

Łukasz Langa  added the comment:

This can be re-closed. Deprecation warnings raised by the test suite are being 
fixed in BPO-44980 which already has an open pull request.

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

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b1db308c6114bb18c06656c94c0ffa73ba954977 by andrei kulakov in 
branch 'main':
bpo-41322: Add unit tests for deprecation of test return values (GH-27846)
https://github.com/python/cpython/commit/b1db308c6114bb18c06656c94c0ffa73ba954977


--

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



[issue41620] Python Unittest does not return results object when the test is skipped

2021-08-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is a bug because there is a difference between the following cases:

@skip("skipped")
def test1(self):
...

@other_decorator
@skip("skipped")
def test2(self):
...

def test2(self):
self.skipTest("skipped")
...

None is only returned in the first case. In other two cases a TestResult is 
returned with information about skipping.

It is obvious that it was unintentionally.

I just have fixed similar bug about calling stopTestRun() (issue44955).

Iman, please add tests and a NEWS entry. You can use tests added in issue44955 
as an example.

--
components: +Library (Lib)
nosy: +serhiy.storchaka
stage:  -> test needed
type:  -> behavior
versions: +Python 3.10, Python 3.9

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Deprecation warnings are not on by default in tests. You can pass -Wall while 
running tests to turn on all warnings.

./python -Wall -m test test_capi
0:00:00 load avg: 2.46 Run tests sequentially
0:00:00 load avg: 2.46 [1/1] test_capi
/home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: 
DeprecationWarning: It is deprecated to return a value!=None from a test case 
()
  warnings.warn(f'It is deprecated to return a value!=None from a '

== Tests result: SUCCESS ==

1 test OK.

Total duration: 5.2 sec
Tests result: SUCCESS

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-21 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I should just add that none of the these tests are actually a problem, i.e. 
they all do run properly and not running duplicate times (except that I'm not 
sure about the 2 distutils tests, but that shouldn't matter much as distutils 
is deprecated and up for removal).

--

___
Python tracker 

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-21 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Karthikeyan: I was looking into them yesterday, and:

 - distutils ones can probably be left as is because distutils are set for 
removal in 3.12

 - test_constructor should be fixed, I can do that today.

 - test_null_strings in test_capi I'm not sure, I think it can also be fixed 
here:
https://github.com/python/cpython/blob/main/Modules/_testcapimodule.c#L2388

   .. by replacing return line with Py_RETURN_NONE;

  but I haven't worked with C tests before and it looks like some other C api 
tests also return non-null and not None values, but they didn't trigger the 
deprecation when running a test PR I made yesterday here:

https://github.com/python/cpython/pull/27869/checks?check_run_id=3387700689

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There are few deprecation warnings in other tests : 

0:00:05 load avg: 3.20 [ 52/428] test_code passed
/home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: 
DeprecationWarning: It is deprecated to return a value!=None from a test case 
(>)
  warnings.warn(f'It is deprecated to return a value!=None from a '

0:00:12 load avg: 3.74 [110/428] test_capi passed
/home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: 
DeprecationWarning: It is deprecated to return a value!=None from a test case 
()
  warnings.warn(f'It is deprecated to return a value!=None from a '

0:00:13 load avg: 3.74 [114/428] test_distutils passed
/home/karthikeyan/stuff/python/cpython/Lib/distutils/tests/test_unixccompiler.py:7:
 DeprecationWarning: The distutils.sysconfig module is deprecated, use 
sysconfig instead
  from distutils import sysconfig
/home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: 
DeprecationWarning: It is deprecated to return a value!=None from a test case 
(>)
  warnings.warn(f'It is deprecated to return a value!=None from a '
/home/karthikeyan/stuff/python/cpython/Lib/unittest/case.py:550: 
DeprecationWarning: It is deprecated to return a value!=None from a test case 
(>)
  warnings.warn(f'It is deprecated to return a value!=None from a '

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-20 Thread Ryan Mast (nightlark)


Ryan Mast (nightlark)  added the comment:

The new issue for the failing test is bpo-44968

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-20 Thread Ryan Mast (nightlark)


Ryan Mast (nightlark)  added the comment:

Sure, I'll open a new issue.

--

___
Python tracker 

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-20 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

The test was refactored in this commit: 
https://github.com/python/cpython/commit/658103f84ea860888f8dab9615281ea64fee31b9

the refactoring moved yield statement from inner func into the test.

That was 8 years ago so it hasn't worked since then, and since asyncio changed 
a lot, I wonder if the test is still valid?

Ryan, do you want to open a new issue for fixing / removing the test?

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-20 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Yes, it seems like this deprecation detected a broken test that wasn't running.

If I add a `raise` statement to it and rerun the test, it still passes on my 
local system:
./python.exe -m unittest -v 
test.test_asyncio.test_events.PollEventLoopTests.test_subprocess_wait_no_same_group
  warnings.warn(f'It is deprecated to return a value!=None from a '
Ran 1 test in 0.022s

OK

(with last line of test being just `raise`).

It seems to me it should be fixed in some way although I don't know if Ryan's 
suggestion will do or not as I haven't looked at asyncio tests before..

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-20 Thread Ryan Mast (nightlark)


Ryan Mast (nightlark)  added the comment:

Would rewriting the test so that it doesn't yield be the right fix?

```
def test_subprocess_wait_no_same_group(self):
# start the new process in a new session
connect = self.loop.subprocess_shell(
functools.partial(MySubprocessProtocol, self.loop),
'exit 7', stdin=None, stdout=None, stderr=None,
start_new_session=True)
_, proto = yield self.loop.run_until_complete(connect)
self.assertIsInstance(proto, MySubprocessProtocol)
self.loop.run_until_complete(proto.completed)
self.assertEqual(7, proto.returncode)
```

to

```
def test_subprocess_wait_no_same_group(self):
# start the new process in a new session
connect = self.loop.subprocess_shell(
functools.partial(MySubprocessProtocol, self.loop),
'exit 7', stdin=None, stdout=None, stderr=None,
start_new_session=True)
transp, proto = self.loop.run_until_complete(connect)
self.assertIsInstance(proto, MySubprocessProtocol)
self.loop.run_until_complete(proto.completed)
self.assertEqual(7, proto.returncode)
transp.close()
```

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-20 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

That test does have a yield statement in it, and does cause the deprecation 
warning to fire off. I'm looking into it..

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-20 Thread Ryan Mast (nightlark)


Ryan Mast (nightlark)  added the comment:

It looks like since GH-27748 got merged, `test_subprocess_wait_no_same_group` 
in `test_asyncio` has been failing for the Ubuntu SSL tests.

--
nosy: +rmast

___
Python tracker 

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



Re: some problems for an introductory python test

2021-08-20 Thread Hope Rouselle
Dennis Lee Bieber  writes:

> On Sun, 15 Aug 2021 00:15:58 -0300, Hope Rouselle 
> declaimed the following:
>
>   Giganews seems to have just vomited up three days worth of traffic...
>
>>Dennis Lee Bieber  writes:
>>
>>>
>>> Granted, the fact that the Amiga used a shared common address space for
>>> all running applications made IPC quite easy -- one looked up the
>>> application message port, then added a small packet to the linked list
>>> associated with the port. That small packet basically held the address of
>>> the message port for returning data, and the address of the data being
>>> passed. The closet thing I've seen to that capability on systems with
>>> process-isolated virtual memory is (Open)VMS "mailbox" structures. The
>>> difference being that the entire data had to be written (QIO) to the
>>> mailbox, and the receiver had to read (another QIO call) the message --
>>> this allowed the address space to change.
>>>
>>> I've not seen anything equivalent in my light perusal of the Win32 API
>>> (the various guide books aren't layed out in any way to be a reference),
>>> and Linux seems to use UNIX sockets for IPC... No way to search for a
>>> connection point by name...
>>
>>I don't know anything about Amiga, REXX et cetera, so I might be totall
>>off here. But since you spoke of your perusal of the Win32 API, let me
>>add a tiny bit.  I gave myself a quick tour through the Win32 API using
>>Pavel Yosifovich's book ``Windows 10 System Programming''.  It's a two
>>volume work.  The thing that impressed me the most was the many ways to
>>do the IPC.  The purpose the work is clearly to show what is available
>>and it it probably does the job well.  (I ignored Windows for most of my
>>life and now I decided to take a look at it.  I don't feel it has much
>>of the elegance of UNIX.  It's what it is.)
>
>   For a book that was published only a year ago -- it seems to be hard to
> find... Amazon has v1, but not v2.

Indeed.  I believe it's because it's not quite released yet.  I had
found it here:

  https://leanpub.com/windows10systemprogrammingpart2

And this seems to be a sort-of-early-release.  I'm not really sure.

>   I have the "Windows Internals 6th" both volumes.
>
>   The closet those get to IPC is something called ALPC -- and that is
> declared to be internal only, not available to third party programmers.
>
>   "Programming Windows 6th" is focused on using C# (which, for the most
> part, means using the "managed" API, not the Win32 API directly).

Makes sense.

>   "Mailslots" (I'm using Google to find Windows IPC options) initially
> sound close to Amiga message ports... Except there is no status return
> inherent to the system; Amiga messages contain a return address so a
> program can wait for the status of processing by the destination address.
> They also don't qualify as VMS mailboxes as there can only be one reader
> (the creator of the mailslot). VMS mailboxes allow multiple writers and/or
> multiple readers.
>
>   "File mapping" doesn't provide any form of queuing -- multiple
> "writers" would require manually implementing some protocol to track "next
> available space" in the mapped file. It would allow bidirectional message
> passing, but again that requires some rather nasty overhead information
> (when is the return status valid -- it is presumed the client wanting the
> return status would get it from the same memory space as the message it
> sent, and that space can't be reused until the client explicitly frees it
> -- again by some overhead protocol changing headers of free space.
>
>   "Data Copy" also sounds close to Amiga message ports (closer than
> "Mailslots"), but the online documentation doesn't indicate if it queues
> messages. The documentation doesn't illustrate HOW to return TRUE or FALSE
> (processed/rejected). It advices that the receiver should treat the data as
> read-only -- though I have to wonder if it /could/ write a return status
> into the same message structure before "returning TRUE".
>
>   Named Pipes and Sockets both have the "tied to endpoints" problem, and
> in the case of Pipes, may only allow one sender to connect at a time
> (sockets are also one connection, but normally the receivers spawns a
> thread for each active connection and the connections are made using
> different allocated sockets).

Thanks for these summaries!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue44960] Add regression test for geometric_mean

2021-08-20 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



[issue44960] Add regression test for geometric_mean

2021-08-20 Thread Irit Katriel

Irit Katriel  added the comment:


New changeset f5d7a8d29c49ad47254fa098abb7a510e5e7b45e by Irit Katriel in 
branch 'main':
bpo-44960: add regression test for geometric_mean with mixed int/floa… (#27856)
https://github.com/python/cpython/commit/f5d7a8d29c49ad47254fa098abb7a510e5e7b45e


--

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



[issue44960] Add regression test for geometric_mean

2021-08-20 Thread Irit Katriel


Change by Irit Katriel :


--
title: Add regression test for geometric test -> Add regression test for 
geometric_mean

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



[issue44960] Add regression test for geometric test

2021-08-20 Thread Irit Katriel


Change by Irit Katriel :


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

___
Python tracker 

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



[issue44960] Add regression test for geometric test

2021-08-20 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue44960] Add regression test for geometric test

2021-08-20 Thread Steven D'Aprano


New submission from Steven D'Aprano :

Hi Irit, thanks for looking at #28327.

Sorry to be That Guy who can't do it himself, but I'm still stuck with old tech 
and ignorance about the git way of doing things, which limits my ability to do 
PRs :-(

Would you be willing to add a regression test for that bug to the 
test_statistics.py file please?

If you can add a test case for this in

class TestGeometricMean

and make a PR that would be great. If you're not willing or able, please just 
reassign back to me and I'll go old school and make a patch file.

Should be fairly straight-forward, just add a method like

def test_regression_28327(self):
# Regression test for b.p.o. #28327
gmean = statistics.geometric_mean
expected = 3.80675409583932
self.assertTrue(math.isclose(gmean([2, 3, 5, 7]), expected))
self.assertTrue(math.isclose(gmean([2.0, 3.0, 5.0, 7.0]), expected))


Thanks.

--
assignee: iritkatriel
messages: 399956
nosy: iritkatriel, steven.daprano
priority: normal
severity: normal
status: open
title: Add regression test for geometric test
type: behavior

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Every new feature should be documented and covered by tests (unless it is very 
trivial or it is very difficult to write a test for it).

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Andrei Kulakov


Change by Andrei Kulakov :


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

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



Re: some problems for an introductory python test

2021-08-19 Thread Hope Rouselle
Chris Angelico  writes:

> On Tue, Aug 17, 2021 at 3:51 AM Hope Rouselle 
> wrote:
>>
>> Chris Angelico  writes:
>> >> Wow, I kinda feel the same as you here.  I think this justifies
>> >> perhaps
>> >> using a hardware solution.  (Crazy idea?! Lol.)
>> >
>> > uhhh Yes. Very crazy idea. Can't imagine why anyone would
>> > ever
>> > think about doing that.
>>
>> Lol.  Really?  I mean a certain panic button.  You know the GNU Emacs.
>> It has this queue with the implications you mentioned --- as much as it
>> can.  (It must of course get the messages from the system, otherwise it
>> can't do anything about it.)  And it has the panic button C-g.  The
>> keyboard has one the highest precedences in hardware interrupts,
>> doesn't
>> it not?  A certain very important system could have a panic button that
>> invokes a certain debugger, say, for a crisis-moment.
>>
>> But then this could be a lousy engineering strategy.  I am not an
>> expert
>> at all in any of this.  But I'm surprised with your quick
>> dismissal. :-)
>>
>> > Certainly nobody in his right mind would have WatchCat listening on
>> > the serial port's Ring Indicator interrupt, and then grab a paperclip
>> > to bridge the DTR and RI pins on an otherwise-unoccupied serial port
>> > on the back of the PC. (The DTR pin was kept high by the PC, and
>> > could
>> > therefore be used as an open power pin to bring the RI high.)
>>
>> Why not?  Misuse of hardware?  Too precious of a resource?
>>
>> > If you're curious, it's pins 4 and 9 - diagonally up and in from the
>> > short
>> > corner. 
>> > http://www.usconverters.com/index.php?main_page=page=61=0
>>
>> You know your pins!  That's impressive.  I thought the OS itself could
>> use something like that.  The fact that they never do... Says
>> something,
>> doesn't it?  But it's not too obvious to me.
>>
>> > And of COURSE nobody would ever take an old serial mouse, take the
>> > ball out of it, and turn it into a foot-controlled signal... although
>> > that wasn't for WatchCat, that was for clipboard management
>> > between my
>> > app and a Windows accounting package that we used. But that's a
>> > separate story.
>>
>> Lol.  I feel you're saying you would. :-)
>
> This was all a figure of speech, and the denials were all tongue in
> cheek. Not only am I saying we would, but we *did*. All of the above.

Cool! :-) 

> The Ring Indicator trick was one of the best, since we had very little
> other use for serial ports, and it didn't significantly impact the
> system during good times, but was always reliable when things went
> wrong.
>
> (And when I posted it, I could visualize the port and knew which pins
> to bridge, but had to go look up a pinout to be able to say their pin
> numbers and descriptions.)

Nice!

>> I heard of Python for the first time in the 90s.  I worked at an ISP.
>> Only one guy was really programming there, Allaire ColdFusion.  But,
>> odd enough, we used to say we would ``write a script in Python'' when
>> we meant to say we were going out for a smoke.  I think that was
>> precisely because nobody knew that ``Python'' really was.  I never
>> expected it to be a great language.  I imagined it was something like
>> Tcl.  (Lol, no offense at all towards Tcl.)
>
> Haha, that's a weird idiom!

Clueless people --- from Rio de Janeiro area in Brazil. :-)  It was
effectively just an in-joke.

> Funny you should mention Tcl.
>
> https://docs.python.org/3/library/tkinter.html

Cool!  Speaking of GUIs and Python, that Google software called Backup
and Sync (which I think it's about to be obsoleted by Google Drive) is
written in Python --- it feels a bit heavy.  The GUI too seems a bit
slow sometimes.  Haven't tried their ``Google Drive'' as a replacement
yet.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

I will add the test in the next 1-2 days, I should have asked if it's needed in 
this case..

--

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +andrei.avk, defreng, ezio.melotti, michael.foord, rbcollins, 
terry.reedy, xtreak, zach.ware

___
Python tracker 

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +lukasz.langa, serhiy.storchaka -fdrake, stefan, terry.reedy
versions: +Python 3.11 -Python 3.7

___
Python tracker 

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread santhosh


Change by santhosh :


--
nosy: +fdrake, stefan, terry.reedy
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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread santhosh


santhosh  added the comment:

def split_module_names(module):
unnamed, named = set(), set()
for name in dir(module):
if not name.startswith('_'):
attr = getattr(module, name)
try:
if hasattr(attr, '__name__'):
named.add(name)
else:
unnamed.add(name)
except TypeError:
pass
return named, unnamed

--
nosy: +santhu_reddy12 -andrei.avk, defreng, ezio.melotti, lukasz.langa, 
michael.foord, rbcollins, serhiy.storchaka, terry.reedy, xtreak, zach.ware
versions: +Python 3.8 -Python 3.11

___
Python tracker 

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Tests are needed.

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

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



[issue44914] tp_version_tag is not unique when test runs with -R :

2021-08-19 Thread Ken Jin


Ken Jin  added the comment:

I just realised I'm slightly wrong about identity checks -- there is a very 
very small chance where if the type object occupies the same address and the 
attribute is in a dynamically allocated __dict__ (and not some static slot), we 
can trick the checks and a segfault may occur for LOAD_ATTR using the old 
opcache in 3.10.

I've tried running tests for 30 repetitions, but I cannot get the segfault to 
appear. @Pablo I'll leave it up to you if you feel it's backport worthy. I 
don't think people use sys._clear_type_cache or PyType_ClearCache normally so 
the chances of this causing any crash is astronomically small.

--

___
Python tracker 

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Łukasz Langa

Change by Łukasz Langa :


--
versions: +Python 3.11 -Python 3.10

___
Python tracker 

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Łukasz Langa

Łukasz Langa  added the comment:

Thanks for reporting, Alexander, and Andrei for the patch! ✨  ✨

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



[issue41322] unittest: deprecate test methods returning non-None values

2021-08-19 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 3db42fc5aca320b0cac1895bc3cb731235ede794 by andrei kulakov in 
branch 'main':
bpo-41322: added deprecation warning for tests returning value!=None (GH-27748)
https://github.com/python/cpython/commit/3db42fc5aca320b0cac1895bc3cb731235ede794


--
nosy: +lukasz.langa

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-18 Thread STINNER Victor


STINNER Victor  added the comment:

You can also play with the clear() method of frame objects and 
traceback.clear_frames() (which expects a traceback object).

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-18 Thread STINNER Victor


STINNER Victor  added the comment:

> test leaked [-4, 4, -4] references, sum=-4

If I disable the GC, the script no longer detects "leaks". Same using a GC 
threshold of 800.

Using a GC threshold between 100 and 700, I reproduce the [-4, 4, -4] 
references leak.

Funny bug.

--

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



[issue44895] refleak test failure in test_exceptions

2021-08-18 Thread STINNER Victor


STINNER Victor  added the comment:

Irit: do you still reproduce the issue using gc.disable()? Or you can try 
different values to call gc.set_threshold(). You may also try different values 
in ns.huntrleaks, like: ns.huntrleaks = (3, 20, 'tt_out.py'). With 20 
iterations, do you still reproduce the leak?

To make the issue more likely, you can change check_rc_deltas() in 
Lib/test/libregrtest/refleak.py. Try:

def check_rc_deltas(deltas):
return any(delta >= 1 for delta in deltas)

With this change, the script stops immediately:

test leaked [-4, 4, -4] references, sum=-4
test leaked [-4, 4, -4] memory blocks, sum=-4

Using 20 iterations, I get:

test leaked [-4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 
4] references, sum=0
test leaked [-4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 4, -4, 
4] memory blocks, sum=0

--

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



[issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite

2021-08-18 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset ebe7e6d86cf8f54d449d49866698d7f4c700cc7c by Miss Islington (bot) 
in branch '3.9':
bpo-44852: Support filtering over warnings without a set message (GH-27793) 
(GH-27810)
https://github.com/python/cpython/commit/ebe7e6d86cf8f54d449d49866698d7f4c700cc7c


--

___
Python tracker 

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



[issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite

2021-08-18 Thread miss-islington


miss-islington  added the comment:


New changeset d1c0e4413dd544270df1f5b8a145fd4370cb759b by Miss Islington (bot) 
in branch '3.10':
bpo-44852: Support filtering over warnings without a set message (GH-27793)
https://github.com/python/cpython/commit/d1c0e4413dd544270df1f5b8a145fd4370cb759b


--

___
Python tracker 

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



[issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite

2021-08-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +26277
pull_request: https://github.com/python/cpython/pull/27810

___
Python tracker 

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



[issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite

2021-08-18 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 2.0 -> 3.0
pull_requests: +26276
pull_request: https://github.com/python/cpython/pull/27809

___
Python tracker 

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



[issue44852] Add ability to wholesale silence DeprecationWarnings while running the test suite

2021-08-18 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset 8cf07d3db3eed02b43350a5f9dbf68f1c839ea82 by Łukasz Langa in 
branch 'main':
bpo-44852: Support filtering over warnings without a set message (GH-27793)
https://github.com/python/cpython/commit/8cf07d3db3eed02b43350a5f9dbf68f1c839ea82


--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

There is some timing-related race condition at hand because I tried in a Linux 
machine and a MacBook Pro (intel) laptop and I wasn't able to reproduce after 
20 min of the script running :(

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-17 Thread Irit Katriel


Irit Katriel  added the comment:

> Could you outline how are you reproducing the leaks?

Sorry I missed this. Just run the script:


iritkatriel@Irits-MBP cpython-1 % ./python.exe refleak.py
-- 1 --
beginning 6 repetitions
123456
..
-- 2 --
beginning 6 repetitions
123456
..
-- 3 --
beginning 6 repetitions
123456
..
test leaked [2, 4, 2] references, sum=8
test leaked [2, 4, 2] memory blocks, sum=8

--

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



[issue44895] refleak test failure in test_exceptions

2021-08-17 Thread Irit Katriel


Irit Katriel  added the comment:

I'm using a mac. It typically fails within at most 10-20 iterations.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-17 Thread Mark Shannon


Mark Shannon  added the comment:

refleak.py seems to run forever for me. Got bored after 6000 iterations.

Which O/S and configure options are needed for refleak.py to fail?

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-17 Thread Irit Katriel


Irit Katriel  added the comment:

This doesn't leak:

try:
raise B()
except B:
tb = sys.exc_info()[1].__traceback__

So this isn't about the traceback being part of the cycle. The B() needs to be 
there too.

--

___
Python tracker 

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



[issue44895] refleak test failure in test_exceptions

2021-08-17 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> But this makes it not leak again, so now we know it's the traceback:

The traceback is a very heavy gc object because it contains the frames, and in 
the locals of the frame is the traceback itself via the exception. This is a 
well known heavy cycle, but the gc should take care of it if the cycle becomes 
isolated

--

___
Python tracker 

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



<    2   3   4   5   6   7   8   9   10   11   >