[issue42109] Use hypothesis for testing the standard library, falling back to stubs

2021-05-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

In order to understand what Paul is concretely proposing, I read and partly 
reviewed his PR.  I thought about maintainability.

Part A adds test.support.hypothesis_helper, similar in purpose to other 
specialized xyz_helper modules.  Hypothesis_helper imports either hypothesis 
itself or a replacement 'as hypothesis'.  The replacement is currently called 
'_hypothesis_stub', but its name is irrelevant as it is normally not seen by 
the user.

Part B adds a second zoneinfo test module, one that uses hypothesis. Besides 
further testing zoneinfo, it serves to test hypothesis_helper and partly 
justify its addition.  It starts with 'from hypothesis_helper import 
hypothesis.  The new test module has tests such as

@hypothesis.given(
dt=hypothesis.strategies.one_of(
hypothesis.strategies.datetimes(), hypothesis.strategies.times()
)
)
@hypothesis.example(dt=datetime.datetime.min)
@hypothesis.example(dt=datetime.datetime.max)
@hypothesis.example(dt=datetime.datetime(1970, 1, 1))
@hypothesis.example(dt=datetime.datetime(2039, 1, 1))
@hypothesis.example(dt=datetime.time(0))
@hypothesis.example(dt=datetime.time(12, 0))
@hypothesis.example(dt=datetime.time(23, 59, 59, 99))
def test_utc(self, dt):
zi = self.klass("UTC")
dt_zi = dt.replace(tzinfo=zi)

self.assertEqual(dt_zi.utcoffset(), ZERO)
self.assertEqual(dt_zi.dst(), ZERO)
self.assertEqual(dt_zi.tzname(), "UTC")

@given always (Paul?) runs the examples as subtests.  When the replacement is 
imported, no randomized examples are added.

If some year an example were to fail, could a hypothesis-ignorant 
zoneinfo-knowing person deal with the failure?  I believe so, knowing that the 
above is equivalent to a test with "for dt in dt_list:\n  with 
self.subTest(...):\n"

Why not require such a rewriting?  Some reasons against: Rewriting by hand can 
lead to errors.  test_utc would have to be split into test_utc_ran(dom) and 
test_utc_pre(set).  Code would have to be duplicated unless factored into a 
third function.  For and with together add two indents, which sometimes 
squeezes assert onto more lines.  I believe that when hypothesis is present, 
there are advantages to including preset examples with given-generated examples.

Paul would like the PR to be a 'camel's nose' in the CPython tent.  This cuts 
both ways.  I think this PR should be judged on its own merits.  Opening 
possibilities can be a merit as long as not seen as pre-approval.  Our CI 
testing and buildbots are already configured to blame and annoy the wrong 
people for random failures.  I don't want more unless failure notices are sent 
to someone responsible for the failing code.

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-05-25 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
Removed message: https://bugs.python.org/msg394414

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-05-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Is it possible to defer hash randomization until after pycs are generated?  The 
underlying problem here is an intentional scrambling of data.  If determinism 
is what is desired then deferring that action addresses the action cause of 
non-determinism rather than a downstream manifestation.

Scrambling hashes provides a somewhat limited (and bypassable) security value.  
What it protects against is maliciously chosen user keys.  That can only occur 
after modules are loaded.  The risk isn't intrinsic to the module itself.

Really, I don't think we should be rewriting sets to achieve this very limited 
goal that benefits very few users. That seems like the tail wagging the dog.

--

___
Python tracker 

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



[issue5758] fileinput.hook_compressed returning bytes from gz file

2021-05-25 Thread Inada Naoki


Inada Naoki  added the comment:

> I did consider and confirm that mode="rb" does also provide a uniform 
> solution, but it also regresses the behavior of uncompressed inputs, making 
> them bytes where they were text.

Of course, I suggested to use "rb" when you want to read bytes.

* When reading binary from uncompressed file, mode="rb" just works for 3.6+.
* When reading text from uncompressed file, mode="r" just works for 3.6+.
* When reading binary from compressed file, mode="rb" just works for 3.6+.
* Reading text from compressed file is not supported until Python 3.10.

--

___
Python tracker 

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



[issue42194] Docs for argparse.BooleanOptionalAction missing "New in version 3.9"

2021-05-25 Thread John Belmonte


John Belmonte  added the comment:

I've opened a new PR, please review.

--

___
Python tracker 

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



[issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string

2021-05-25 Thread Catherine Devlin


Catherine Devlin  added the comment:

All that said, it's easy to imagine a PyPI package that would give this 
functionality for those who want it.  Maybe even one that could also alter the 
behavior of Click and Typer.  If you want to go that route, let me know.

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-05-25 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +24967
pull_request: https://github.com/python/cpython/pull/26375

___
Python tracker 

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



[issue44208] argparse: Accept option without needing to distinguish "-" from "_" in arg_string

2021-05-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

William, thank you for the suggestion, but we're going to decline for the 
reasons listed by Eric and me.

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Victor, can you take a look at the opened PRs?

--

___
Python tracker 

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



[issue43921] test_ssl fails on Windows buildbots

2021-05-25 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks for the explanation!

> They're flakey in the sense that they're not failing reliably, when they 
> clearly should be :)

Yeah, I do agree with you in this, but I am still not happy that they 
*realiably* pass in 3.9 and 3.8 in two different OS where now they fail: 
Windows and MacOS

> But short of that, I don't see anything deterministic changed here.

Well, but the test *deterministically* fail in 3.10 and main and don't fail in 
3.9 or 3.8. And it also happens in MacOS.

I really don't want to be annoying here, I really don't. But please, understand 
my position as RM when I say that I feel uncomfortable with this situation as 
the test pass without any problem or complication in previous releases and now 
they don't and there has been a huge change in OpenSSL in the middle.

Also, the asyncio tests for SSL now hang a lot in the refleak buildbots. For 
example:

https://buildbot.python.org/all/#/builders/673/builds/20

I feel uncomfortable with a solution that basically is "skip the tests", when 
the test before used to pass deterministically and without problems. I am not 
an expert in the SSL area by far, so I don't know exactly what is the risk here.

I really apologize if I am insisting on this, but I think is important.

--

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Neil Schemenauer


Change by Neil Schemenauer :


--
nosy: +nascheme

___
Python tracker 

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



[issue44222] Improving _removeHandlerRef for a very long _handlerList

2021-05-25 Thread Yonatan Goldschmidt


Change by Yonatan Goldschmidt :


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



[issue43921] test_ssl fails on Windows buildbots

2021-05-25 Thread Steve Dower


Steve Dower  added the comment:

> But 3.9 and 3.8 are not failing on test_ssl, so do something has clearly 
> changed. Are the failing tests new?

They're flakey in the sense that they're not failing reliably, when they 
clearly should be :)

If something changed about how any part of the response is written into the 
buffer, it could change when the OS decides to dispatch it and unblock the 
receiving thread, which is going to affect the state observed by the test at 
the time it observes it (and as we already know, there are inherent race 
conditions that sometimes recognise the close of the connection before it's 
finished reading). These are difficult tests to write, because there are so 
many weird interactions like this.

In terms of this actual change, my best guess is that one of the removed checks 
actually mattered on Windows, probably because of a different compile flag. We 
just use the defaults as generated by their Perl scripts, and I'd hope that 
there'd be compile errors if anything too blatant was changed (I don't see 
anything obvious looking through 39258d3595300bc7b952854c915f63ae2d4b9c3e). But 
short of that, I don't see anything deterministic changed here.

--

___
Python tracker 

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



[issue44222] Improving _removeHandlerRef for a very long _handlerList

2021-05-25 Thread miss-islington


miss-islington  added the comment:


New changeset 156699bca02dd2def844d03e26fc16a831336635 by Yonatan Goldschmidt 
in branch 'main':
bpo-44222: Improve _removeHandlerRef() for a very long _handlerList (GH-26325)
https://github.com/python/cpython/commit/156699bca02dd2def844d03e26fc16a831336635


--
nosy: +miss-islington

___
Python tracker 

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



[issue44092] [sqlite3] Remove special rollback handling

2021-05-25 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Berker, does this look ok to you?

--
title: [sqlite3] consider removing special rollback handling -> [sqlite3] 
Remove special rollback handling

___
Python tracker 

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



[issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout()

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24966
pull_request: https://github.com/python/cpython/pull/26374

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Thanks! Hashlib PR comin' up.

--

___
Python tracker 

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



[issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24965
pull_request: https://github.com/python/cpython/pull/26373

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24964
pull_request: https://github.com/python/cpython/pull/26373

___
Python tracker 

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



[issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests:  -24962

___
Python tracker 

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



[issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests:  -24961

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24963
pull_request: https://github.com/python/cpython/pull/26372

___
Python tracker 

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



[issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24962
pull_request: https://github.com/python/cpython/pull/26373

___
Python tracker 

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



[issue42792] [MacOS] Can't open file in a separate (threading.Thread) thread

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
nosy: +erlendaasland
nosy_count: 4.0 -> 5.0
pull_requests: +24961
pull_request: https://github.com/python/cpython/pull/26372

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24960
pull_request: https://github.com/python/cpython/pull/26371

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24959
pull_request: https://github.com/python/cpython/pull/26370

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Christian Heimes


Christian Heimes  added the comment:

Please open PRs and assign them to me. I'll review them as soon as possible.

--

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Christian, I've got a PR ready for Modules/_ssl.c, but I won't submit it if 
you'd rather do it yourself. I'll stay off the sha/md5 types unless you approve 
:)

--
nosy: +christian.heimes

___
Python tracker 

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



[issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-25 Thread Alexei S

Alexei S  added the comment:

I downloaded tar.gz of Python-3.8.9 and Python-3.9.4 into my ~/Downloads folder 
(~/Загрузки in Russian)
extracted them, after that executed:

chmod +x configure
CXX=/usr/bin/g++ ./configure --enable-optimizations
make -j4

problems the same for both Python versions

--

___
Python tracker 

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



[issue43921] test_ssl fails on Windows buildbots

2021-05-25 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Also, this seems to be reproducible in MacOS at least:

https://bugs.python.org/issue44229

--

___
Python tracker 

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



[issue43216] Removal of @asyncio.coroutine in Python 3.11

2021-05-25 Thread Illia Volochii


Change by Illia Volochii :


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

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24957
pull_request: https://github.com/python/cpython/pull/26368

___
Python tracker 

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



[issue43921] test_ssl fails on Windows buildbots

2021-05-25 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

> Looking at the output, I think the tests are just going to be inherently 
> flakey. It's not testing the specific scenario directly enough, and relying 
> heavily on implicit synchronization.

But 3.9 and 3.8 are not failing on test_ssl, so do something has clearly 
changed. Are the failing tests new?

--

___
Python tracker 

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



[issue43921] test_ssl fails on Windows buildbots

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:

> Looking at the output, I think the tests are just going to be inherently 
> flakey. It's not testing the specific scenario directly enough, and relying 
> heavily on implicit synchronization.

My notes to debug race conditions:
https://pythondev.readthedocs.io/unstable_tests.html#debug-race-conditions

In general, you should run the same test in a loop in many processes in 
parallel *and* stress the machine with a random workload.

My favorite recipe:

* Terminal 1: python -m test -F -j20 <... options for the test ...>
* Terminal 2: python -m test -j0 -r -F

Sadly, there is no silver bullet for -j20: sometimes, the machine must be "more 
idle" to trigger the bug (ex: -j5), sometimes the machine must almost die, be 
more stressed (-j100).

Happy hacking!

--
nosy: +vstinner

___
Python tracker 

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



[issue43921] test_ssl fails on Windows buildbots

2021-05-25 Thread Steve Dower


Steve Dower  added the comment:

I can't reproduce these on my own (Windows) machine either.

Looking at the output, I think the tests are just going to be inherently 
flakey. It's not testing the specific scenario directly enough, and relying 
heavily on implicit synchronization.

We probably just need a different approach to testing these. I think at the 
very least starting the server on the main test thread and using a helper to 
send the request is going to be easier to keep things in sync. 

But that's not going to be done in time to unblock. Skipping the test seems 
like an okay compromise.

--

___
Python tracker 

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



[issue37439] Add random.binomialvariate()

2021-05-25 Thread Mark Dickinson


Mark Dickinson  added the comment:

Nope, that's the wrong paper. It looks as though this is the right one, but 
it's hidden behind a paywall: https://dl.acm.org/doi/abs/10.1145/42372.42381

--

___
Python tracker 

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



[issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout()

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:

> https://github.com/python/cpython/pull/26359/checks?check_run_id=2668874284

test.pythoninfo:

ssl.HAS_SNI: True
ssl.OPENSSL_VERSION: OpenSSL 1.1.1k  25 Mar 2021
ssl.OPENSSL_VERSION_INFO: (1, 1, 1, 11, 15)
ssl.OP_ALL: 0x8054
ssl.OP_NO_TLSv1_1: 0x1000
ssl.SSLContext.maximum_version: MAXIMUM_SUPPORTED
ssl.SSLContext.minimum_version: TLSv1_2
ssl.SSLContext.options: 
OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x8054
ssl.SSLContext.protocol: PROTOCOL_TLS_CLIENT
ssl.SSLContext.verify_mode: CERT_REQUIRED
ssl.default_https_context.maximum_version: MAXIMUM_SUPPORTED
ssl.default_https_context.minimum_version: TLSv1_2
ssl.default_https_context.options: 
OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x8054
ssl.default_https_context.protocol: PROTOCOL_TLS_CLIENT
ssl.default_https_context.verify_mode: CERT_REQUIRED
ssl.stdlib_context.maximum_version: MAXIMUM_SUPPORTED
ssl.stdlib_context.minimum_version: TLSv1_2
ssl.stdlib_context.options: 
OP_NO_COMPRESSION|OP_ENABLE_MIDDLEBOX_COMPAT|OP_CIPHER_SERVER_PREFERENCE|OP_NO_SSLv3|0x8054
ssl.stdlib_context.protocol: PROTOCOL_TLS_CLIENT
ssl.stdlib_context.verify_mode: CERT_NONE

--

___
Python tracker 

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



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout()

2021-05-25 Thread Christian Heimes


Christian Heimes  added the comment:

It looks like a duplicate or very similar to bpo-44229.

--
dependencies: +test_get_server_certificate fails intermittently on macOS

___
Python tracker 

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



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bd199e72fb60a8ff001a023f23925092a290be91 by Victor Stinner in 
branch 'main':
bpo-44232: Fix type_new() error reporting (GH-26359)
https://github.com/python/cpython/commit/bd199e72fb60a8ff001a023f23925092a290be91


--

___
Python tracker 

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



[issue44237] test_ssl randomly fails on macOS GH Action: test_get_server_certificate_sni() and test_get_server_certificate_timeout()

2021-05-25 Thread STINNER Victor


New submission from STINNER Victor :

https://github.com/python/cpython/pull/26359/checks?check_run_id=2668874284

Error 1:

2021-05-25T20:02:41.9174160Z 
==
2021-05-25T20:02:41.9268350Z ERROR: test_get_server_certificate_sni 
(test.test_ssl.SimpleBackgroundTests)
2021-05-25T20:02:41.9272030Z 
--
2021-05-25T20:02:41.9275950Z Traceback (most recent call last):
2021-05-25T20:02:41.9374600Z   File 
"/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2147, in 
test_get_server_certificate_sni
2021-05-25T20:02:41.9404170Z pem = ssl.get_server_certificate((host, port), 
ca_certs=SIGNING_CA)
2021-05-25T20:02:41.9483350Z   File 
"/Users/runner/work/cpython/cpython/Lib/ssl.py", line 1520, in 
get_server_certificate
2021-05-25T20:02:41.9505910Z with create_connection(addr, timeout=timeout) 
as sock:
2021-05-25T20:02:41.9585510Z   File 
"/Users/runner/work/cpython/cpython/Lib/socket.py", line 844, in 
create_connection
2021-05-25T20:02:41.9607200Z raise err
2021-05-25T20:02:41.9687730Z   File 
"/Users/runner/work/cpython/cpython/Lib/socket.py", line 832, in 
create_connection
2021-05-25T20:02:41.9708730Z sock.connect(sa)
2021-05-25T20:02:41.9791030Z ConnectionRefusedError: [Errno 61] Connection 
refused

Error 2 when test_ssl is re-run:

==
FAIL: test_get_server_certificate_timeout (test.test_ssl.SimpleBackgroundTests)
--
Traceback (most recent call last):
  File "/Users/runner/work/cpython/cpython/Lib/test/test_ssl.py", line 2165, in 
test_get_server_certificate_timeout
with self.assertRaises(socket.timeout):
AssertionError: TimeoutError not raised

--
assignee: christian.heimes
components: SSL, Tests
messages: 394392
nosy: christian.heimes, vstinner
priority: normal
severity: normal
status: open
title: test_ssl randomly fails on macOS GH Action: 
test_get_server_certificate_sni() and test_get_server_certificate_timeout()
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



[issue37439] Add random.binomialvariate()

2021-05-25 Thread Mark Dickinson


Mark Dickinson  added the comment:

I think the NumPy implementation may be from here: 
https://core.ac.uk/download/pdf/11007254.pdf

(though I'm struggling to find a clear citation in the NumPy source)

--

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-05-25 Thread Eric Snow


Change by Eric Snow :


--
pull_requests: +24955
pull_request: https://github.com/python/cpython/pull/26364

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Erlend E. Aasland


Change by Erlend E. Aasland :


--
pull_requests: +24954
pull_request: https://github.com/python/cpython/pull/26363

___
Python tracker 

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



[issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:

> I think the only thing I'd improve would be to mention that this issue is the 
> one that introduced the bug, otherwise it looks a bit weird.

Ok, done: 
https://python-security.readthedocs.io/vuln/ipaddress-ipv4-leading-zeros.html#timeline

--

___
Python tracker 

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



[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-25 Thread Shreyan Avigyan

Shreyan Avigyan  added the comment:

Sorry, 1.0 and 1.1 refer to  not 1.1 and 1.2

--

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread miss-islington


miss-islington  added the comment:


New changeset 534da740a2586357d204ab5f446295b9ce220787 by Miss Islington (bot) 
in branch '3.10':
bpo-42972: Fully implement GC protocol for arraymodule types (GH-26114)
https://github.com/python/cpython/commit/534da740a2586357d204ab5f446295b9ce220787


--

___
Python tracker 

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



[issue44217] Tkinter/IDLE: literal astral char discombobulates text editing

2021-05-25 Thread Shreyan Avigyan

Shreyan Avigyan  added the comment:

I executed the code Tal provided and yes both Serhiy and Tal you're right. It 
seems the backspace problem is related to Tcl/Tk's indexing. 1.1 and 1.2 both 
refer to . Also the dancing I told actually tells why this is happening. Since 
Tcl/Tk uses BMP it treats  also as 2 bytes. Now when we move the typing cursor 
from right to left using arrow keys the  gets split into ??. Notice there are 
two ?. So it's all coming together now.

--
components: +Tkinter

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset bd404ccac0d3e8358995ac0cbeec9373bb6c4d96 by Erlend Egeberg 
Aasland in branch 'main':
bpo-42972: Fully implement GC protocol for arraymodule types (GH-26114)
https://github.com/python/cpython/commit/bd404ccac0d3e8358995ac0cbeec9373bb6c4d96


--

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24953
pull_request: https://github.com/python/cpython/pull/26362

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread miss-islington


miss-islington  added the comment:


New changeset e8d9df0089e30a06d837fa2cfbd070e01531701f by Miss Islington (bot) 
in branch '3.10':
bpo-42972: Fully implement GC protocol for sqlite3 heap types (GH-26104)
https://github.com/python/cpython/commit/e8d9df0089e30a06d837fa2cfbd070e01531701f


--

___
Python tracker 

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



[issue40551] PRs should be rebased on top of master before running the build/tests

2021-05-25 Thread Filipe Laíns

Change by Filipe Laíns :


--
resolution:  -> works for me
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



[issue37439] Add random.binomialvariate()

2021-05-25 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

A presumed optimal version of this is already available in numpy.

https://numpy.org/doc/stable/reference/random/generated/numpy.random.Generator.binomial.html

https://github.com/numpy/numpy/blob/2232a473f8713f532c8164c8cf616f7bd05f54a7/numpy/random/_generator.pyx#L2805

--
nosy: +gregory.p.smith
versions: +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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +24952
pull_request: https://github.com/python/cpython/pull/26361

___
Python tracker 

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



[issue42972] [C API] Heap types (PyType_FromSpec) must fully implement the GC protocol

2021-05-25 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d3c277a59c3d93fb92f7026f63678083d1d49fc5 by Erlend Egeberg 
Aasland in branch 'main':
bpo-42972: Fully implement GC protocol for sqlite3 heap types (GH-26104)
https://github.com/python/cpython/commit/d3c277a59c3d93fb92f7026f63678083d1d49fc5


--

___
Python tracker 

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



[issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-25 Thread Alexei S

Alexei S  added the comment:

make test TESTOPTS="-v test_embed test_tabnanny"
 CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g -fwrapv 
-O3 -Wall'  _TCLTK_INCLUDES='' _TCLTK_LIBS=''   ./python -E ./setup.py  
build
running build
running build_ext

The following modules found by detect_modules() in setup.py, have been
built by the Makefile instead, as configured by the Setup files:
_abc  atexitpwd
time   

running build_scripts
copying and adjusting /home/alexei/Загрузки/Python-3.9.4/Tools/scripts/pydoc3 
-> build/scripts-3.9
copying and adjusting /home/alexei/Загрузки/Python-3.9.4/Tools/scripts/idle3 -> 
build/scripts-3.9
copying and adjusting /home/alexei/Загрузки/Python-3.9.4/Tools/scripts/2to3 -> 
build/scripts-3.9
changing mode of build/scripts-3.9/pydoc3 from 664 to 775
changing mode of build/scripts-3.9/idle3 from 664 to 775
changing mode of build/scripts-3.9/2to3 from 664 to 775
renaming build/scripts-3.9/pydoc3 to build/scripts-3.9/pydoc3.9
renaming build/scripts-3.9/idle3 to build/scripts-3.9/idle3.9
renaming build/scripts-3.9/2to3 to build/scripts-3.9/2to3-3.9
./python -E -c 'import sys ; from sysconfig import get_platform ; 
print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
./python  ./Tools/scripts/run_tests.py -v test_embed test_tabnanny
/home/alexei/Загрузки/Python-3.9.4/python -u -W default -bb -E -m test -r -w -j 
0 -u all,-largefile,-audio,-gui -v test_embed test_tabnanny
== CPython 3.9.4 (default, May 25 2021, 18:48:10) [GCC 9.3.0]
== Linux-5.8.0-48-generic-x86_64-with-glibc2.31 little-endian
== cwd: /home/alexei/Загрузки/Python-3.9.4/build/test_python_58488æ
== CPU count: 4
== encodings: locale=UTF-8, FS=utf-8
Using random seed 464094
0:00:00 load avg: 0.41 Run tests in parallel using 6 child processes
0:00:01 load avg: 0.53 [1/2/1] test_tabnanny failed
test_correct_directory (test.test_tabnanny.TestCheck)
Directory which contains few error free python source code files. ... ok
test_correct_directory_verbose (test.test_tabnanny.TestCheck)
Directory containing few error free python source code files. ... ok
test_correct_file (test.test_tabnanny.TestCheck)
A python source code file without any errors. ... ok
test_errored_directory (test.test_tabnanny.TestCheck)
Directory containing wrongly indented python source code files. ... ok
test_when_nannynag_error (test.test_tabnanny.TestCheck)
A python source code file eligible for raising `tabnanny.NannyNag`. ... ok
test_when_nannynag_error_verbose (test.test_tabnanny.TestCheck)
A python source code file eligible for raising `tabnanny.NannyNag`. ... ok
test_when_no_file (test.test_tabnanny.TestCheck)
A python file which does not exist actually in system. ... ok
test_when_tokenize_tokenerror (test.test_tabnanny.TestCheck)
A python source code file eligible for raising 'tokenize.TokenError'. ... ok
test_when_wrong_indented (test.test_tabnanny.TestCheck)
A python source code file eligible for raising `IndentationError`. ... ok
test_command_usage (test.test_tabnanny.TestCommandLine)
Should display usage on no arguments. ... ERROR
test_double_verbose_mode (test.test_tabnanny.TestCommandLine)
Should display detailed error information if double verbose is on. ... ok
test_quiet_flag (test.test_tabnanny.TestCommandLine)
Should display less when quite mode is on. ... ok
test_verbose_mode (test.test_tabnanny.TestCommandLine)
Should display more error information if verbose mode is on. ... ok
test_with_error_free_file (test.test_tabnanny.TestCommandLine)
Should not display anything if python file is correctly indented. ... ok
test_with_errored_file (test.test_tabnanny.TestCommandLine)
Should displays error when errored python file is given. ... ok
test_errprint (test.test_tabnanny.TestErrPrint)
Asserting result of `tabnanny.errprint()` by giving sample inputs. ... ok
test_format_witnesses (test.test_tabnanny.TestFormatWitnesses)
Asserting formatter result by giving various input samples. ... ok
test_all_methods (test.test_tabnanny.TestNannyNag)
Asserting behaviour of `tabnanny.NannyNag` exception. ... ok
test_with_correct_code (test.test_tabnanny.TestProcessTokens)
A python source code without any whitespace related problems. ... ok
test_with_errored_codes_samples (test.test_tabnanny.TestProcessTokens)
A python source code with whitespace related sampled problems. ... ok

==
ERROR: test_command_usage (test.test_tabnanny.TestCommandLine)
Should display usage on no arguments.
--
Traceback (most recent call last):
  File "/home/alexei/Загрузки/Python-3.9.4/Lib/test/test_tabnanny.py", line 
324, in test_command_usage
self.validate_cmd(stderr=stderr)
  File "/home/alexei/Загрузки/Python-3.9.4/Lib/test/test_tabnanny.py", line 
296, in validate_cmd
err = 

[issue44233] Provide Windows Terminal Fragment Extension

2021-05-25 Thread Steve Dower


Steve Dower  added the comment:

Thanks! This is a great idea.

I'd prioritise adding support to the Store app first, as that's easier to 
manage (we're not having to modify files owned by other apps outside of our 
install directory). But no reason we couldn't extend the older installer and 
make that do it as well.

We probably want to experiment a bit with what goes into it. I think this 
should probably be a single profile that uses the default Python (whatever 
"python.exe" maps to), but it could also be a Powershell/Cmd shell that has 
PATH set (though *that* is redundant with the Store package, so perhaps better 
for the regular installer).

I *really* don't want to fill up Terminal with one (or more) profiles for each 
Python version. I'm trying to motivate other work to make it easier for users 
to have multiple installs but one consistent default, so I'd rather not 
multiplex here.

--

___
Python tracker 

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



[issue44226] Threads shutting down in Py 2.7 but not in Py 3.69 while making SSH connection using Paramiko module

2021-05-25 Thread Muralidhar BN


Muralidhar BN  added the comment:

We have checked this issue by adapting another 3rd party SSH packages ( replace 
paramiko with pyssh). Using this we have found same o/p results. Which means it 
is not 3rd party SSH package ( paramiko or pyssh) issue. 

Issue report in Paramiko github will be removed 
(https://github.com/paramiko/paramiko/issues/1856)

To our analysis this issue is not observed when "logging" module is disabled. 
Request to provide your analysis from python perspective ?

Executing code qa-test-execute.py in Py 2.7 (Ubuntu 14.04.6 LTS)

Command 1 :
sudo python ./qa-test-execute.py

Output 1 :

2021-05-25 21:23:44,889[BaseCommandLine __init__ 140392385488400][DEBUG]: 
Attempt to close ssh-session within 10.0 seconds.
Exception AssertionError: 'attempt to release recursive lock not owned by 
thread' in > ignored

Command 2 :

2021-05-25 21:23:44,889[BaseCommandLine __init__ 140392385488400][DEBUG]: 
Attempt to close ssh-session within 10.0 seconds.
Exception AssertionError: 'attempt to release recursive lock not owned by 
thread' in > ignored


Executing code qa-test-execute.py in Py 3.69 (Ubuntu 18.04.5 LTS)

Command 1 :
sudo python3 ./qa-test-execute.py

Output 1 :
2021-05-25 22:32:54,945[BaseCommandLine __init__ 140490991571128][DEBUG]: 
Attempt to close ssh-session within 10.0 seconds.
2021-05-25 22:32:54,945[BaseCommandLine __init__ 140490991571128][DEBUG]: 
Closing internal ssh-client.
Fatal Python error: could not acquire lock for <_io.BufferedWriter 
name=''> at interpreter shutdown, possibly due to daemon threads

Thread 0x7fc69880e700 (most recent call first):
  File "/usr/lib/python3.6/logging/__init__.py", line 997 in emit
  File "/usr/lib/python3.6/logging/__init__.py", line 865 in handle
  File "/usr/lib/python3.6/logging/__init__.py", line 1516 in callHandlers
  File "/usr/lib/python3.6/logging/__init__.py", line 1454 in handle
  File "/usr/lib/python3.6/logging/__init__.py", line 1444 in _log
  File "/usr/lib/python3.6/logging/__init__.py", line 1296 in debug
  File "./qa-test-execute_sajal.py", line 132 in __nonblocking_close1
  File "/usr/lib/python3.6/threading.py", line 864 in run
  File "/usr/lib/python3.6/threading.py", line 916 in _bootstrap_inner
  File "/usr/lib/python3.6/threading.py", line 884 in _bootstrap

Current thread 0x7fc69dab5740 (most recent call first):
  File "./qa-test-execute_sajal.py", line 48 in call_with_timeout1
  File "./qa-test-execute_sajal.py", line 117 in close1
  File "./qa-test-execute_sajal.py", line 83 in __del__
Aborted (core dumped)

Command 2 :
sudo python3 ./qa-test-execute.py 2>&1 | tee 
launcher_gt20907_24052021_execute_py369_1.log

Output 2 :
2021-05-25 22:33:26,393[BaseCommandLine __init__ 140711046725760][DEBUG]: 
Attempt to close ssh-session within 10.0 seconds.
2021-05-25 22:33:26,393[BaseCommandLine __init__ 140711046725760][DEBUG]: 
Closing internal ssh-client.
^C



Behaviour of same code is different when executed in Py 2.7 & Py 3.69. 
 
qa-test-execute.py
#!/usr/bin/env python3

import sys
import traceback
import logging
import logging.config
import time
import threading
import multiprocessing
import pyssh



def lock_acquire_with_timeout1(lock, timeout_seconds):
"""
Try to acquire lock without specified timeout
@param lock: threading lock to be acquired
@type lock: threading.Lock
@param timeout_seconds: maximal time to make lock acquire attempts
@type timeout_seconds: float
"""
begin_time = time.time()
while time.time() - begin_time < timeout_seconds:
if lambda: lock.acquire(False):
return True
else:
time.sleep(1.0)
return None


def call_with_timeout1(method_to_call, timeout_seconds):
"""
Good for potentially "freeze" methods calls. Executes passed method in
separate thread. Waits for control returns within timeout. If timeout
exceed - return control to callee thread. Separate execution thread will
still be active.

@param method_to_call: method te be called
@type method_to_call: function
@param timeout_seconds: maximal time to wait for method call finished
@type timeout_seconds: float
"""
stop_thread = threading.Barrier(2)
thread_name = threading._newname("{}-%d".format(__name__))
call_thread = threading.Thread(target=method_to_call, name=thread_name)
call_thread.daemon = True
call_thread.start()
print ("threading.activeCount() : %s",threading.activeCount())
print ("threading.currentThread() : %s", threading.currentThread())
print ("threading.enumerate() : %s", threading.enumerate() )
call_thread.join(timeout=timeout_seconds)
if call_thread.is_alive():
stop_thread.abort()
return not call_thread.is_alive()


def format_all_threads_stacks1():
"""
@return: formatted stacks for all running threads.
"""
stacktraces = []
for thread_id, stack in 

[issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2021-05-25 Thread George-Cristian Bîrzan

George-Cristian Bîrzan  added the comment:

I think the only thing I'd improve would be to mention that this issue is the 
one that introduced the bug, otherwise it looks a bit weird.

--

___
Python tracker 

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



[issue36384] [security] CVE-2021-29921: ipaddress Should not reject IPv4 addresses with leading zeroes as ambiguously octal

2021-05-25 Thread STINNER Victor

STINNER Victor  added the comment:

George-Cristian Bîrzan: "The timeline there is wrong."

Fixed: 
https://python-security.readthedocs.io/vuln/ipaddress-ipv4-leading-zeros.html#timeline

The strange part is "2019-03-20 (-741 days): Python issue bpo-36384 reported by 
Joel Croteau".

The problem is that this issue was "reused" for two different things: the 
initial change and the vulnerability.

Maybe I can removed the reference to the bpo to remove it from the timeline 
(and put it in links).

--

___
Python tracker 

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



[issue42109] Use hypothesis for testing the standard library, falling back to stubs

2021-05-25 Thread Paul Ganssle

Paul Ganssle  added the comment:

> I use hypothesis during development, but don't have a need for in the the 
> standard library.  By the time code lands there, we normally have a specific 
> idea of what edge cases needs to be in the tests.

The suggestion I've made here is that we use @example decorators to take the 
hypothesis tests you would have written already and turn them in to what are 
essentially parameterized tests. For anyone who doesn't want to explicitly run 
the hypothesis test suite, the tests you are apparently already writing would 
simply turn into normal tests for just the edge cases.

One added benefit of keeping the tests around in the form of property tests is 
that you can run these same tests through hypothesis to find regressions in 
bugfixes that are implemented after landing (e.g. "Oh we can add a fast path 
here", which introduces a new edge case). The segfault bug from bpo-34454, for 
example, would have been found if I had been able to carry over the 
hypothesis-based tests I was using during the initial implementation of 
fromisoformat into later stages of the development. (Either because I didn't 
run it long enough to hit that particular edge case or because that edge case 
didn't come up until after I had moved the development locus into the CPython 
repo, I'm not sure).

Another benefit of keeping them around is that they become fuzz targets, 
meaning people like oss-fuzz or anyone who wants to throw some fuzzing 
resources at CPython have an existing body of tests that are expected to pass 
on *any* input, to find especially obscure bugs.

> For the most part, hypothesis has not turned up anything useful for the 
> standard library.  Most of the reports that we've gotten reflected a 
> misunderstanding by the person running hypothesis rather than an actual bug. 
> [...]

I don't really think it's a good argument to say that it hasn't turned up 
useful bugs. Most of the bugs in a bit of code will be found during development 
or during the early stages of adoption, and we have very wide adoption. I've 
found a number of bugs in zoneinfo using hypothesis tests, and I'd love to 
continue using them in CPython rather than throwing them away or maintaining 
them in a separate repo.

I also think it is very useful for us to write tests about the properties of 
our systems for re-use in PyPy (which does use hypothesis, by the way) and 
other implementations of Python. This kind of "define the contract and maintain 
tests to enforce that" is very helpful for alternate implementations.

> For numeric code, hypothesis is difficult to use and requires many 
> restrictions on the bounds of variables and error tolerances.  [...]

I do not think that we need to make hypothesis tests mandatory. They can be 
used when someone finds them useful.

> The main area where hypothesis seems easy to use and gives some comfort is in 
> simple roundtrips:  assert zlib.decompress(zlib.compress(s)) == s.  However, 
> that is only a small fraction of our test cases.

Even if this were the only time that hypothesis were useful (I don't think it 
is), some of these round-trips can be among the trickiest and important code to 
test, even if it's a small fraction of the tests. We have a bunch of functions 
that are basically "Load this file format" and "Dump this file format", usually 
implemented in C, which are a magnet for CVEs and often the target for fuzz 
testing for that reason. Having a small library of maintained tests for round 
tripping file formats seems like it would be very useful for people who want to 
donate compute time to fuzz test CPython (or other implementations!)

> Speed is another issue.  During development, it doesn't matter much if 
> Hypothesis takes a lot of time exercising one function.  But in the standard 
> library tests already run slow enough to impact development.  If hypothesis 
> were to run everytime we run a test suite, it would make the situation worse.

As mentioned in the initial ticket, the current plan I'm suggesting is to have 
fallback stubs which turn your property tests into parameterized tests when 
hypothesis is not installed. If we're good about adding `@example` decorators 
(and certainly doing so is easier than writing new ad hoc tests for every edge 
case we can think of when we already have property tests written!), then I 
don't see any particular reason to run the full test suite against a full 
hypothesis run on every CI run.

My suggestion is:

1. By default, run hypothesis in "stubs" mode, where the property tests are 
simply parameterized tests.
2. Have one or two CI jobs that runs *only* the hypothesis tests, generating 
new examples — since this is just for edge case detection, it doesn't 
necessarily need to run on every combination of architecture and platform and 
configuration in our testing matrix, just the ones where it could plausibly 
make a difference.
3. Ask users who are adding new hypothesis tests or who find new bugs to add 

[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-05-25 Thread Filipe Laíns

Filipe Laíns  added the comment:

What about normal sets? They also suffer from the same issue.

--

___
Python tracker 

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



[issue44131] [C API] Add tests on Py_FrozenMain()

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:

commit eaede0ded72e67cee4a91c086847d54cb64ca74c
Author: Victor Stinner 
Date:   Mon May 17 23:48:35 2021 +0200

bpo-44131: Test Py_FrozenMain() (GH-26126)

* Add test_frozenmain to test_embed
* Add Programs/test_frozenmain.py
* Add Programs/freeze_test_frozenmain.py
* Add Programs/test_frozenmain.h
* Add make regen-test-frozenmain
* Add test_frozenmain command to Programs/_testembed
* _testembed.c: add error(msg) function

commit 58a993957abec7e47acb20376d2753051fa75452
Author: Victor Stinner 
Date:   Thu May 20 12:08:05 2021 +0200

bpo-44131: Py_FrozenMain() uses PyConfig_SetBytesArgv() (GH-26201)

Moreover, Py_FrozenMain() relies on Py_InitializeFromConfig() to
handle the PYTHONUNBUFFERED environment variable and configure C
stdio streams like stdout (make the stream unbuffered).

--

___
Python tracker 

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



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:

> We noticed a behavior change in [1].

Hey, well done bisection, you're right, it's a regression of my large 
type_new() refactoring in bpo-43770.

I wrote PR 26359 to fix it.

--

___
Python tracker 

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



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +24951
pull_request: https://github.com/python/cpython/pull/26359

___
Python tracker 

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



[issue44050] [subinterpreters] _PyImport_FixupExtensionObject() regression in Python 3.9

2021-05-25 Thread Trygve Aaberge


Trygve Aaberge  added the comment:

> The _PyImport_FixupExtensionObject() change impacts extensions using the 
> legacy API and so should not be used in subinterpreters.

I'm not using that directly in my code, but I guess it's used indirectly? If it 
shouldn't be used, what's the alternative in 3.9?

> Maybe the old behavior was better: if an extension uses the old API, share 
> its state between all interpreters.

Since this worked fine as far as I know before 3.9, and currently breaks 
existing applications, this is probably better yes.

--

___
Python tracker 

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



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread Ken Jin


Change by Ken Jin :


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

___
Python tracker 

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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-05-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Possible solution: add an ordered subtype of frozenset which would keep an 
array of items in the original order. The compiler only creates frozenset when 
optimizes "x in {1, 2}" or "for x in {1, 2}". It should now create an ordered 
frozenset from a list of constants (removing possible duplicates). The marshal 
module should save items in that order and restore ordered frozensets when load 
data. It should not increase memory consumption too much, because frozenset 
constants in code are rare and small.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue44214] PyArg_Parse* for vectorcall?

2021-05-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There are alternative ideas of parsing API which should be considered:

1. Linearize keyword arguments using _PyArg_UnpackKeywords() and parse the 
linear array of arguments with a variant of _PyArg_ParseStack().

2. Parse arguments outside of the user function and pass already parsed values 
(as in Argument Clinic). Or just pre-process keyword arguments and pass a 
continuous array of arguments with possible NULLs for optional parameters. 
Specification for parsing arguments should be added to PyMethodDef.

I do not know what idea will work better, it needs experimentation.

--

___
Python tracker 

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



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread Ken Jin


Ken Jin  added the comment:

Alright, I got a minimum reproducible example:

class XBase(type):
def __new__(cls, name, bases, attrs, **kwargs):
attrs.pop('__module__')
return super().__new__(cls, name, bases, attrs, **kwargs)

class X(metaclass=XBase): ...

type('A', (X, ), {})


This triggers it, sending patch soon.

--

___
Python tracker 

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



[issue44010] IDLE: highlight soft keywords

2021-05-25 Thread Tal Einat


Tal Einat  added the comment:

IMO this can be closed, so I'm closing this.  (Terry is welcome to reopen this 
if needed.)

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



[issue44236] Define SOABI, LIBRARY, LDLIBRARY and LIBPL on Windows

2021-05-25 Thread Steve Dower


Steve Dower  added the comment:

Should actually be:

LIBPL=Path(sysconfig.get_config_var("installed_base")) / "libs"

--

___
Python tracker 

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



[issue44236] Define SOABI, LIBRARY, LDLIBRARY and LIBPL on Windows

2021-05-25 Thread Steve Dower


New submission from Steve Dower :

Python on Windows currently has no values in sysconfig to locate the lib files 
for building. Though these are very predictable (for now), it would be nice to 
have them in the same place as for other platforms.

I propose defining the following config vars in sysconfig:

LIBRARY=Path(_winapi.GetModuleFileName(sys.dllhandle)).stem
LDLIBRARY=Path(_winapi.GetModuleFileName(sys.dllhandle)).name
LIBPL=Path(sys.prefix) / "libs"
SOABI=

Are there better shared names for these? Or others that should be added?

--
components: Windows
messages: 394368
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Define SOABI, LIBRARY, LDLIBRARY and LIBPL on Windows
versions: Python 3.10, Python 3.11

___
Python tracker 

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



[issue44229] test_get_server_certificate fails intermittently on macOS

2021-05-25 Thread Erlend E. Aasland

Erlend E. Aasland  added the comment:

Yes, sorry ‘bout the cryptic messages :)

This is against current main branch (I’m not at my computer right now, so I 
don’t have the git ref). The first two failures came after 328 and 389 runs. 
Increasing the timeout (using test.support.SHORT_TIMEOUT) made it harder 
trigging the failure (~500 repetitions).

I’ll try to declutter when I’m back on my computer.

--

___
Python tracker 

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



[issue44010] IDLE: highlight soft keywords

2021-05-25 Thread E. Paine


E. Paine  added the comment:

Can we close this, or are we leaving it open for when (if) we do a colouriser 
refactor?

--

___
Python tracker 

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



[issue44235] Remove l*gettext() and related functions in the gettext module

2021-05-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Go ahead!

--

___
Python tracker 

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



[issue44235] Remove l*gettext() and related functions in the gettext module

2021-05-25 Thread Dong-hee Na


Dong-hee Na  added the comment:

@serhiy

If you are okay, can I process this issue?

--

___
Python tracker 

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



[issue44214] PyArg_Parse* for vectorcall?

2021-05-25 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Annoyingly the keywords variant is the most interesting to expose :-) due to 
the complexity of correctly interpreting keyword arguments.

I agree that we should be careful in exposing the APIs using _PyArg_Parser, 
although it should be easer to expose it only in the non-stable ABI because 
extensions should be recompiled for new python releases anyway.

That said, I won't work on this issue myself (or at least not anytime soon). My 
current use case doesn't use keyword arguments, and open coding the calls to 
PyArg_ParseTuple is easy enough for now (even if that leads to more 
boilerplate).

--

___
Python tracker 

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



[issue44235] Remove l*gettext() and related functions in the gettext module

2021-05-25 Thread Dong-hee Na


New submission from Dong-hee Na :

Those APIs were planned to remove at Python 3.10.
Now it's python 3.11 it looks okay to remove now.

--
components: Library (Lib)
messages: 394362
nosy: corona10, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Remove l*gettext() and related functions in the gettext module
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



[issue37596] Reproducible pyc: frozenset is not serialized in a deterministic order

2021-05-25 Thread Filipe Laíns

Filipe Laíns  added the comment:

I would not expect SOURCE_DATE_EPOCH to sacrifice performance. During 
packaging, SOURCE_DATE_EPOCH is always set, and sometimes we need to perform 
expensive operations. We only need this behavior during cache generation, 
making the solution not optimal.

Backtracking a bit to your proposal for sorting the elements. Is it possible to 
have two different types with the same name? We need a unique identifier for 
each type.
After that, we need the type to allow sorting/comparing items, which AFAIK is 
not something we can guarantee.
We could certainly do the sorting where we are able to, and bail out if 
impossible, which I feel should handle the majority of cases. This is not 
optimal, but reasonable.

Is there any way we could something like resetting the hash seed during cache 
generation?

--

___
Python tracker 

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



[issue42392] [document removal of] the deprecated 'loop' parameter asyncio API in 3.10

2021-05-25 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +24949
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/26357

___
Python tracker 

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



[issue20408] memoryview() constructor documentation error

2021-05-25 Thread Berker Peksag


Change by Berker Peksag :


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

___
Python tracker 

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



[issue20408] memoryview() constructor documentation error

2021-05-25 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 8accb8c8ccf371021cba5a2b91f5b7c711fa8149 by Miss Islington (bot) 
in branch '3.9':
bpo-20408: Fix memoryview() signature in docs (GH-24431)
https://github.com/python/cpython/commit/8accb8c8ccf371021cba5a2b91f5b7c711fa8149


--

___
Python tracker 

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



[issue20408] memoryview() constructor documentation error

2021-05-25 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 05f8ad0c745016cd8b5bdbda4336688b80f45fd7 by Miss Islington (bot) 
in branch '3.10':
bpo-20408: Fix memoryview() signature in docs (GH-24431)
https://github.com/python/cpython/commit/05f8ad0c745016cd8b5bdbda4336688b80f45fd7


--

___
Python tracker 

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



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal
priority: normal -> release blocker

___
Python tracker 

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



[issue20408] memoryview() constructor documentation error

2021-05-25 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +24947
pull_request: https://github.com/python/cpython/pull/26355

___
Python tracker 

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



[issue20408] memoryview() constructor documentation error

2021-05-25 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset d18e5dae914b1db49b25ed7729c07a535d1f0c52 by Mariusz Felisiak in 
branch 'main':
bpo-20408: Fix memoryview() signature in docs (GH-24431)
https://github.com/python/cpython/commit/d18e5dae914b1db49b25ed7729c07a535d1f0c52


--

___
Python tracker 

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



[issue20408] memoryview() constructor documentation error

2021-05-25 Thread miss-islington


Change by miss-islington :


--
pull_requests: +24948
pull_request: https://github.com/python/cpython/pull/26356

___
Python tracker 

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



[issue38768] [feature request] Add lldb equivalent to Tools/gdb

2021-05-25 Thread Dong-hee Na


Change by Dong-hee Na :


--
nosy: +corona10

___
Python tracker 

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



[issue44229] test_get_server_certificate fails intermittently on macOS

2021-05-25 Thread Christian Heimes


Christian Heimes  added the comment:

me, too. Did the change of import for timeout setting cause the issue?

--

___
Python tracker 

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



[issue44234] Debugging with LLDB doesn't work for universal2 installer on macOS Big Sur

2021-05-25 Thread Ronald Oussoren


New submission from Ronald Oussoren :

I've installed python 3.9.5 using the universal2 installer on my M1 MacBook.

Debugging this python using lldb doesn't work because the debugger cannot 
attach to the (newly launched) binary.  This appears to be due to a missing 
entitlement in the signed executable.

Background: 
https://developer.apple.com/forums/thread/676028?answerId=666834022#666834022 
(in particular the first reply).

--
components: Build, macOS
messages: 394356
nosy: ned.deily, ronaldoussoren
priority: normal
severity: normal
stage: needs patch
status: open
title: Debugging with LLDB doesn't work for universal2 installer on macOS Big 
Sur
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



[issue44229] test_get_server_certificate fails intermittently on macOS

2021-05-25 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Erlend, could you maybe add some context to the messages, unfortunately, I am 
failing to understand what they mean :(

--

___
Python tracker 

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



[issue44031] python3.8.9, python3.9.2 test_embed test_tabnanny failed

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:

> make test TESTOPTS="-v test_embed test_tabnanny"

I'm talking about commands *before make test. How did you get the tarball? How 
did you configure Python? How did you build it?

log_configure 3.9.2.log  doesn't contain the configure command.

log_make 3.9.2.log doesn't contain the make command.

--

___
Python tracker 

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



[issue44231] Remove _PyTuple_FromArray from the public API

2021-05-25 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue44231] Remove _PyTuple_FromArray from the public API

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1b940eb410e2755538a36d87fe4aa8d8783183d6 by Erlend Egeberg 
Aasland in branch 'main':
bpo-44231: Don't export internal _PyTuple_FromArray() symbol (GH-26352)
https://github.com/python/cpython/commit/1b940eb410e2755538a36d87fe4aa8d8783183d6


--

___
Python tracker 

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



[issue44156] [subinterpreters] Replace static string caches with subinterpreter-compatible alternatives

2021-05-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 29669245d4ad760f43853a7a0434143090135331 by Ken Jin in branch 
'main':
bpo-44156: Make cached string constants in compile.c subinterpreter compatible 
(GH-26161)
https://github.com/python/cpython/commit/29669245d4ad760f43853a7a0434143090135331


--

___
Python tracker 

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



[issue44232] Crash in Objects/typeobject.c

2021-05-25 Thread Ken Jin


Ken Jin  added the comment:

Can you please try removing the `assert(type != NULL);` line at 
https://github.com/python/cpython/blob/main/Objects/typeobject.c#L3313 and see 
if it works for you? I suspect that `winner->tp_new()` may sometimes fail and 
*should* return NULL to indicate that in those cases, so the assert may not 
always hold.

--
nosy: +kj

___
Python tracker 

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



[issue44229] test_get_server_certificate fails intermittently on macOS

2021-05-25 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

$ git diff
diff --git a/Lib/ssl.py b/Lib/ssl.py
index 2b131de043..9c281d8028 100644
--- a/Lib/ssl.py
+++ b/Lib/ssl.py
@@ -257,8 +257,9 @@ class _TLSMessageType:
 if sys.platform == "win32":
 from _ssl import enum_certificates, enum_crls
 
+from test.support import SHORT_TIMEOUT as _GLOBAL_DEFAULT_TIMEOUT
 from socket import socket, SOCK_STREAM, create_connection
-from socket import SOL_SOCKET, SO_TYPE, _GLOBAL_DEFAULT_TIMEOUT
+from socket import SOL_SOCKET, SO_TYPE
 import socket as _socket
 import base64# for DER-to-PEM translation
 import errno

$ % ./python.exe -m test test_ssl -m test_get_server_certificate -u all -F
...
0:03:27 load avg: 2.24 [535] test_ssl
test test_ssl failed -- Traceback (most recent call last):
  File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2132, 
in test_get_server_certificate
_test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA)
  File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2329, 
in _test_get_server_certificate
pem = ssl.get_server_certificate((host, port), ca_certs=cert)
  File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1521, in 
get_server_certificate
with create_connection(addr, timeout=timeout) as sock:
  File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 844, in 
create_connection
raise err
  File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 832, in 
create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

test_ssl failed

== Tests result: FAILURE ==

--

___
Python tracker 

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



[issue44229] test_get_server_certificate fails intermittently on macOS

2021-05-25 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Got it:

0:02:29 load avg: 2.81 [389] test_ssl
test test_ssl failed -- Traceback (most recent call last):
  File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2132, 
in test_get_server_certificate
_test_get_server_certificate(self, *self.server_addr, cert=SIGNING_CA)
  File "/Users/erlendaasland/src/cpython-ssl/Lib/test/test_ssl.py", line 2329, 
in _test_get_server_certificate
pem = ssl.get_server_certificate((host, port), ca_certs=cert)
  File "/Users/erlendaasland/src/cpython-ssl/Lib/ssl.py", line 1520, in 
get_server_certificate
with create_connection(addr, timeout=timeout) as sock:
  File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 844, in 
create_connection
raise err
  File "/Users/erlendaasland/src/cpython-ssl/Lib/socket.py", line 832, in 
create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

test_ssl failed

== Tests result: FAILURE ==

--

___
Python tracker 

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



  1   2   >