[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

xml.etree.cElementTree should be treated in the same way as cStringIO and 
cPickle -- they where separate modules in the past, but now the acceleration is 
used by default in io.StringIO and pickle. It looks an oversign that it was not 
removed in 3.0.

xml.etree.cElementTree was deprecated since 3.3. I think 6 releases (3.3-3.8) 
is long enough period. It was not possible to emit a deprecation warning at 
runtime for reasons mentioned above. And we did not have deprecation warnings 
for cStringIO and cPickle for the same reasons.

defusedxml is the only known to me package which does not fall back to 
xml.etree.ElementTree. I hope it is easy to fix it. In Python 
xml.etree.cElementTree is the same as xml.etree.ElementTree, so you can just 
import xml.etree.ElementTree. And you can use the above mentioned idiom if you 
still support Python 2.

--

___
Python tracker 

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



[issue40489] INCREF/DECREFs around the rich comparison needs tests

2020-05-05 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thank you.

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



[issue40507] FileNotFound error raised by os.exec* doesn't contain filename

2020-05-05 Thread Russell Davis


Change by Russell Davis :


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

___
Python tracker 

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



[issue40508] IDLE won't open

2020-05-05 Thread Ned Deily


Change by Ned Deily :


--
assignee:  -> terry.reedy
components: +IDLE -macOS
nosy: +terry.reedy

___
Python tracker 

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



[issue40508] IDLE won't open

2020-05-05 Thread Louis


Change by Louis :


--
components: macOS
files: IDLE.app.zip
nosy: Louis, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: IDLE won't open
type: performance
versions: Python 3.6
Added file: https://bugs.python.org/file49120/IDLE.app.zip

___
Python tracker 

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



[issue40496] re.findall() takes a long time (100% cup usage) on Python 3.6.10

2020-05-05 Thread Sergio Rael

Sergio Rael  added the comment:

Thank you for your reply Rémi.

I agree with you that the reason can be that the pattern is too complex. I just 
noticed that in Python 3.7 using the same pattern finish the searchall almost 
instantaneously, but in 3.6 the CPU goes to 100% and it takes ages to finish. 
In fact I don't know if this can finish at all because it takes so long that I 
had to stop it.
I tough it would be a good idea to let you know this behaviour. Of course, 
after this, I don't use 3.6 anymore.

Thanks again!

--

___
Python tracker 

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



[issue40508] IDLE won't open

2020-05-05 Thread Louis


Louis  added the comment:

Mac OS Catalina 10.15.4

--

___
Python tracker 

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



[issue40508] IDLE won't open

2020-05-05 Thread Ned Deily


Ned Deily  added the comment:

Thanks for submitting the version of IDLE you were using.  It appears to be a 
Python 3.6.1 from 2017; the version is very old-of-date and no longer 
supported.  Python 3.6.x is now in security fix mode only; Python 3.8.2 is now 
current.  Unless you have a reallygood reason to stick with it you should 
download and use the latest version from here:

https://www.python.org/downloads/

The reason you are getting the bad cpy type message is that the 3.6.1 variant 
you are trying to use was built for 32-bit architectures only.  macOS 10.15 no 
longer supports running 32-bit executables.  The most recent downloads from 
python.org for macOS are 64-bit executables and work fine on 10.15.

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

___
Python tracker 

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



[issue40508] IDLE won't open

2020-05-05 Thread Louis


Louis  added the comment:

Thank You for your reply

-Louis

--

___
Python tracker 

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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Miro for information. It looks as awesome work!

The simplest solution would be to restore xml.etree.cElementTree and keep it 
forever. It will not harm anyone, it is just outdated import here and there.

We could also write an import hook which would analyze the code of the importer 
and warn only if xml.etree.cElementTree is imported without a common idiom. But 
it looks slightly overcomplicated to me.

And we can just let the users to fix they code for 3.9.

--

___
Python tracker 

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



[issue40496] re.findall() takes a long time (100% cup usage) on Python 3.6.10

2020-05-05 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is hard to say what is the problem, but seems it was solved in 3.7. Either 
it was an optimization, or a bug fix which had such side effect. If it was a 
bug fix, it was one of backward incompatible bugfixes which are not backported 
to older versions.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Christian Heimes


Christian Heimes  added the comment:

Stefan wrote:
> Christian, I understand your complaint, but I've actually never seen code in 
> the wild that didn't provide a fallback for the import, usually something 
> like what Serhiy spelled out

My package defusedxml broke with the change. Python's documention recommends my 
package for parsing XML from untrusted sources. defusedxml 0.7.0rc1 addresses 
the problem by removing defusedxml.cElementTree in 3.9, too. The fix is going 
to break other packages, too.

Serhiy wrote:
> xml.etree.cElementTree should be treated in the same way as cStringIO and 
> cPickle -- they where separate modules in the past, but now the acceleration 
> is used by default in io.StringIO and pickle. It looks an oversign that it 
> was not removed in 3.0.

I completely agree with you. It should have been removed with 3.0. But this 
fact doesn't grant a carte blanche to remove the module without a deprecation 
phase with a proper deadline.

Stefan wrote:
> So, how do we deal with this? We can't warn about the deprecation without 
> annoying everyone. We can't just remove the empty module without breaking 
> lots of code. We also can't really let the module stick around forever and 
> let people write more code that uselessly imports it.

I prefer annoyance over getting broking by surprise. If the current deprecation 
warning system doesn't work for us, then we need to come up with a better plan. 
In the mean time please give users one release head star to adjust their code. 
I propose that feature shall not be removed in 3.x unless the documentation of 
3.(x-1).0 release has explicitly stated the removal of a feature (unless other 
special circumstances and general consense require it).

* Add deprecation and removal warning for xml.etree.cElementTree to 
whatsnew/3.9.rst
* Remove xml.etree.cElementTree in 3.10

--

___
Python tracker 

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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Christian Heimes


Christian Heimes  added the comment:

IMHO we don't have to spend extra work on an import hook. It might be a good 
idea to raise the problem with https://github.com/PyCQA/, though. Large 
projects tend to use code checkers and linters.

--

___
Python tracker 

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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Stefan Behnel

Stefan Behnel  added the comment:

It's not like the deprecation was hidden – the ET docs have this line right at 
the top:

"Changed in version 3.3: This module will use a fast implementation whenever 
available. The xml.etree.cElementTree module is deprecated."

https://docs.python.org/3/library/xml.etree.elementtree.html

But as I said, people don't read docs.

I agree that it's best to keep the module "for now", and maybe leave it to IDEs 
and code checkers to spread the deprecation notice for us. As Serhiy said, it 
doesn't hurt us much to have it.

--

___
Python tracker 

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



[issue40508] IDLE won't open

2020-05-05 Thread Louis


New submission from Louis :

Hi, I cannot open IDLE. When i try and open it from finder it says that the 
file could not be opened. When I try and open it from the dock, it bounces once 
and then nothing else happens. When i try and open it from terminal, it says 
that there is a bad cpu type in the executable.

-Louis

--

___
Python tracker 

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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Miro Hrončok

Miro Hrončok  added the comment:

Some stats: See 
https://bugzilla.redhat.com/showdependencytree.cgi?id=PYTHON39_resolved=0 
and Ctrl+F for cElementTree.

--

___
Python tracker 

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



[issue40350] modulefinder chokes on numpy - dereferencing None in spec.loader

2020-05-05 Thread Cajetan Rodrigues


Change by Cajetan Rodrigues :


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

___
Python tracker 

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



[issue40350] modulefinder chokes on numpy - dereferencing None in spec.loader

2020-05-05 Thread Cajetan Rodrigues


Cajetan Rodrigues  added the comment:

Turns out using _PKG_DIRECTORY as a type for namespace packages ended up making 
`_find_module` try to search for an __init__.py within them, since it had no 
understanding of the diff. between a namespace package and a regular one (the 
lack of __init__.py), and caused it to break.

I've raised a PR with a new type _NSP_DIRECTORY for namespace-directories.

--

___
Python tracker 

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



[issue40508] IDLE won't open

2020-05-05 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

What version of macOS do you use?

--

___
Python tracker 

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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Stefan Behnel


Stefan Behnel  added the comment:

Thanks Miro, that's beautiful. Good to know that I'm not the only one who 
doesn't read documentation. ;-)

So, how do we deal with this? We can't warn about the deprecation without 
annoying everyone. We can't just remove the empty module without breaking lots 
of code. We also can't really let the module stick around forever and let 
people write more code that uselessly imports it.

Any ideas?

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-05-05 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


--
nosy: +remi.lapeyre
nosy_count: 7.0 -> 8.0
pull_requests: +19232
pull_request: https://github.com/python/cpython/pull/19918

___
Python tracker 

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



[issue36543] Remove old-deprecated ElementTree features (part 2)

2020-05-05 Thread Christian Heimes


Christian Heimes  added the comment:

3.3.0 was released in 2012. That's almost a lifetime ago. I assume that 
majority of users either forgot, missed the note, or no longer took the 
deprecation serious. After seven, eight years we should do our users a service 
and point out the deprecation with a concrete deadline.

--

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-05-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

I can't mark the issue as open thought, can someone do this?

--

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-05-05 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

>> Regardless, how can we best move forward with this idea?

> Provide a pull request.

Hi, I looked into what scientific programs where doing. Most of them uses a 
form of the Baillie–PSW primality test which is a probabilistic primality test 
that's never wrong up to 2**64 and for which their is currently no known 
pseudoprime.

This first version I wrote uses a deterministic variant of the Miller-Rabin 
test for n < 3317044064679887385961981. For larger n, a probabilistic 
Miller-Rabin test is used with s=25 random bases. The probabilistic 
Miller-Rabin test is never wrong when it concludes that n is composite and has 
a probability of error of 4^(-s) when it concludes that n is prime.

The implementations of next_prime() and previous_prime() are straightforward 
and factorise() uses the Phollard's rho heuristic which gives satisfactory 
results for numbers with small factors. It's a generator as it may hang when n 
has very large factors e.g. 2**(2**8)+1.

I implemented all functions Steven D'Aprano suggested but did not bother with 
the sieve as Tim Peters already provided one in the python-ideas thread. The 
code is in imath for now but I can move it.

Hopefully this is enough to bikeshed the API, if this proposal is accepted I 
will write more tests and fix any bug found.

--

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-05-05 Thread Christian Heimes


Christian Heimes  added the comment:

It seems we agree that prime functions only appear to be easy until you realize 
that they are far from trivial. :)

+1 to require a PEP. I'm happy to give my feedback on crypto and 
security-related part of the feature.

OpenSSL now uses 64 MR rounds for small and 128 for larger primes 
(https://github.com/openssl/openssl/blob/278260bfa238aefef5a1abe2043d2f812c3a4bd5/crypto/bn/bn_prime.c#L87-L99)
 and trial divisions to update to 2048 tests 
(https://github.com/openssl/openssl/blob/278260bfa238aefef5a1abe2043d2f812c3a4bd5/crypto/bn/bn_prime.c#L70-L85).

--

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-05-05 Thread Christian Heimes


Change by Christian Heimes :


--
stage: resolved -> 

___
Python tracker 

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



[issue40514] Add --experimental-isolated-subinterpreters build option

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19242
pull_request: https://github.com/python/cpython/pull/19927

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

Python/ceval.c also has "int _Py_CheckRecursionLimit = 
Py_DEFAULT_RECURSION_LIMIT;". _Py_CheckRecursiveCall() has this comment:

/* Needed for ABI backwards-compatibility (see bpo-31857) */
_Py_CheckRecursionLimit = recursion_limit;

I converted Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() macros into 
opaque functions in bpo-38644: commit f4b1e3d7c64985f5d5b00f6cc9a1c146bbbfd613.

I don't think that the "ABI backwards-compatibility" rationale is correct. 
These macros never worked in the limited C API: they accessed 
PyThreadState.recursion_depth and PyThreadState.overflowed members, whereas the 
PyThreadState structure is opaque in the limited C API (on purpose, see also 
bpo-39947).

I think that it is now safe to simply remove _Py_CheckRecursionLimit.

--

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0b1e3307e24b0af45787ab6456535b8346e0239a by Victor Stinner in 
branch 'master':
bpo-40513: Per-interpreter gil_drop_request (GH-19927)
https://github.com/python/cpython/commit/0b1e3307e24b0af45787ab6456535b8346e0239a


--

___
Python tracker 

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



[issue40514] Add --experimental-isolated-subinterpreters build option

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

--with-experimental-isolated-subinterpreters option name is very long on 
purpose: to advertize that you must not use it, unless you fully understand its 
purpose :-)

I didn't document the build option in Misc/SpecialBuilds.txt or 
Doc/whatsnew/3.9.rst on purpose: you should not use this special build :-) 
Basically, this option is only for Eric Snow and me :-D

--

___
Python tracker 

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



[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b0be6b3b94fbdf31b796adc19dc86a04a52b03e1 by Victor Stinner in 
branch 'master':
bpo-29587: _PyErr_ChainExceptions() checks exception (GH-19902)
https://github.com/python/cpython/commit/b0be6b3b94fbdf31b796adc19dc86a04a52b03e1


--

___
Python tracker 

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



[issue40417] PyImport_ReloadModule emits deprecation warning

2020-05-05 Thread Robert Rouhani


Change by Robert Rouhani :


--
pull_requests: +19249
pull_request: https://github.com/python/cpython/pull/19934

___
Python tracker 

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



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-05 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +19251
pull_request: https://github.com/python/cpython/pull/19936

___
Python tracker 

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



[issue38787] PEP 573: Module State Access from C Extension Methods

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-40137: TODO list when PEP 573 "Module State Access from C 
Extension Methods" will be implemented.

--
nosy: +vstinner

___
Python tracker 

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



[issue36284] importlib.import_module() not thread safe if Exception is raised (3.4, 3.5)

2020-05-05 Thread Patrick Thizy


Patrick Thizy  added the comment:

I use Apache + mod_wsgi on Windows
When I update from Django 2.2.4 to Django 2.2.5, this fix has been apply
With this fix my application is not running
The navigator is lock and waiting 

Can you help me ?

--
nosy: +Patrick Thizy

___
Python tracker 

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



[issue40504] Restore weakref support for lru_cache wrappers

2020-05-05 Thread Dennis Sweeney


Change by Dennis Sweeney :


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

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset fb2c7c4afbab0514352ab0246b0c0cc85d1bba53 by Victor Stinner in 
branch 'master':
bpo-40513: _xxsubinterpreters.run_string() releases the GIL (GH-19944)
https://github.com/python/cpython/commit/fb2c7c4afbab0514352ab0246b0c0cc85d1bba53


--

___
Python tracker 

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



[issue40512] Meta issue: per-interpreter GIL

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

Attached demo.py: benchmark to compare performance of sequential execution, 
threads and subinterpreters.

--
Added file: https://bugs.python.org/file49124/demo.py

___
Python tracker 

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



[issue40522] Subinterpreters: get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40458] test_bad_getattr crashes on APPX test

2020-05-05 Thread Steve Dower

Steve Dower  added the comment:

Merged without the improved diagnostics. I might add that later if I get time.

Łukasz - this is a fairly trivial crash fix that'd be nice (and safe) to pull 
into 3.8.3, but not critical. Your call.

--
assignee:  -> steve.dower
nosy: +lukasz.langa
stage: patch review -> commit review

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

> FWIW, I think it would make sense to keep "signals_pending" under 
> _PyRuntimeState rather than moving it to PyInterpreterState.

Oh right. I forgot about the details. I reverted my change, but this time I 
added a comment to prevent me to write the same change in 6 months :-)

--

___
Python tracker 

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



[issue40521] Make tuple, dict, frame free lists, unicode interned strings, unicode latin1 singletons per-interpreter

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 607b1027fec7b4a1602aab7df57795fbcec1c51b by Victor Stinner in 
branch 'master':
bpo-40521: Disable Unicode caches in isolated subinterpreters (GH-19933)
https://github.com/python/cpython/commit/607b1027fec7b4a1602aab7df57795fbcec1c51b


--

___
Python tracker 

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



[issue38323] asyncio: MultiLoopWatcher has a race condition (test_asyncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x)

2020-05-05 Thread Kyle Stanley


Kyle Stanley  added the comment:

I have also explored a few different solutions and was unable to find a fix for 
this issue. If it's still causing intermittent hangs after Andrew's patch, we 
may want to consider skipping `test_close_kill_running` for `MultiLoopWatcher` 
until we can find one. This clearly seems to be a complex issue without an easy 
solution, and I don't think we want it to potentially mask other issues in the 
meantime.

--

___
Python tracker 

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



[issue40458] test_bad_getattr crashes on APPX test

2020-05-05 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue40458] test_bad_getattr crashes on APPX test

2020-05-05 Thread Steve Dower


Steve Dower  added the comment:


New changeset ac4bf424119d1300f57929120968e216a85d3a25 by Steve Dower in branch 
'master':
bpo-40458: Increase reserved stack space to prevent overflow crash on Windows 
(GH-19845)
https://github.com/python/cpython/commit/ac4bf424119d1300f57929120968e216a85d3a25


--

___
Python tracker 

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



[issue40521] Make tuple, dict, frame free lists, unicode interned strings, unicode latin1 singletons per-interpreter

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b4b53868d7d6cd13505321d3802fd00865b25e05 by Victor Stinner in 
branch 'master':
bpo-40521: Disable free lists in subinterpreters (GH-19937)
https://github.com/python/cpython/commit/b4b53868d7d6cd13505321d3802fd00865b25e05


--

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19257
pull_request: https://github.com/python/cpython/pull/19943

___
Python tracker 

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



[issue40458] test_bad_getattr crashes on APPX test

2020-05-05 Thread miss-islington


miss-islington  added the comment:


New changeset a6a116c1b964b3d1fdff0f533861ed2a2227de1f by Miss Islington (bot) 
in branch '3.8':
bpo-40458: Increase reserved stack space to prevent overflow crash on Windows 
(GH-19845)
https://github.com/python/cpython/commit/a6a116c1b964b3d1fdff0f533861ed2a2227de1f


--

___
Python tracker 

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



[issue40521] Make tuple, dict, frame free lists, unicode interned strings, unicode latin1 singletons per-interpreter

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19252
pull_request: https://github.com/python/cpython/pull/19937

___
Python tracker 

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



[issue40522] Subinterpreters: get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-05-05 Thread STINNER Victor


New submission from STINNER Victor :

_PyThreadState_GET() gets the current Python thread state from 
_PyRuntime.gilstate.tstate_current atomic variable.

When I experimented per-interpreter GIL (bpo-40512), I got issues with 
_PyThreadState_GET() which didn't return the expected Python thread state.

I propose to modify _PyThreadState_GET() in the exprimental isolated 
subinterpreters mode to get and set the current Python thread state using a 
Thread Local Storage: autoTSSkey.

--
components: Interpreter Core
messages: 368182
nosy: vstinner
priority: normal
severity: normal
status: open
title: Subinterpreters: get the current Python interpreter state from Thread 
Local Storage (autoTSSkey)
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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19256
pull_request: https://github.com/python/cpython/pull/19942

___
Python tracker 

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



[issue17254] add thai encoding aliases to encodings.aliases

2020-05-05 Thread Benjamin Wood


Benjamin Wood  added the comment:

This is an easy alias to a valid codepage. I supplied proof that they are the 
same.

I don't understand why this has been allowed to languish for 9 months.

Did I miss something? Is there more work I need to do?

Thanks

--

___
Python tracker 

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



[issue40524] Print() issue

2020-05-05 Thread Code436


New submission from Code436 :

When I tried to print some stuff I get a KeyError:0

--

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19258
pull_request: https://github.com/python/cpython/pull/19944

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 0dd5e7a718997da2026ed64fe054dc36cae4fee7 by Victor Stinner in 
branch 'master':
bpo-40513: new_interpreter() init GIL earlier (GH-19942)
https://github.com/python/cpython/commit/0dd5e7a718997da2026ed64fe054dc36cae4fee7


--

___
Python tracker 

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



[issue40246] Different error messages for same error - invalid string prefixes

2020-05-05 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Ok, I'm closing this, after consulting with Guido.

--
resolution:  -> wont fix
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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

> From a user perspective, does it make sense to have a different 
> recursion_limit per interpreter?

Yes, I think so. Someone might use a lower limit to run a template rendering 
engine or "unsafe" code. Well, it's not hard to find random usage for 
interpreters with a configuration different than the main interpreter.

--

___
Python tracker 

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



[issue40512] Meta issue: per-interpreter GIL

2020-05-05 Thread Kyle Stanley


Change by Kyle Stanley :


--
nosy: +aeros

___
Python tracker 

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



[issue40512] Meta issue: per-interpreter GIL

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-40522: "Subinterpreters: get the current Python interpreter state 
from Thread Local Storage (autoTSSkey)".

--

___
Python tracker 

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



[issue40522] Subinterpreters: get the current Python interpreter state from Thread Local Storage (autoTSSkey)

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e838a9324c1719bb917ca81ede8d766b5cb551f4 by Victor Stinner in 
branch 'master':
bpo-40522: _PyThreadState_Swap() sets autoTSSkey (GH-19939)
https://github.com/python/cpython/commit/e838a9324c1719bb917ca81ede8d766b5cb551f4


--

___
Python tracker 

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



[issue18857] urlencode of a None value uses the string 'None'

2020-05-05 Thread James Addison


James Addison  added the comment:

Chiming in here to add that I'd appreciate the ability to render 'standalone' 
(i.e. no '=') query-string keys in order to distinguish between 
absence-of-value and empty-string situations.

The backwards-compatibility concerns in here are genuine, so perhaps this could 
be introduced as an argument to urlencode with a disabled default value, 
allowing developers to opt-in.

>> Unless someone can point to a "real" web server that does something 
>> different with "" than with "=", there is no reason to make a change 
>> to Python.

There's a popular nodejs library that makes this serialization distinction 
explicit: https://github.com/sindresorhus/query-string#falsy-values

I've developed a Python 3.7-based set of commits[1] to address this issue.  I 
haven't yet opened this as a pull request since I see that Python 3.7 is in 
maintenance/bugfix mode[2].

In case a new urlencode flag would fall under the category of feature, I'll aim 
to develop a subsequent set of commits against the master development branch 
soon.

[1] - https://github.com/jayaddison/cpython/compare/3.7..9555467

[2] - https://devguide.python.org/#status-of-python-branches

--
nosy: +jayaddison

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7be4e350aadf93c4be5c97b7291d0db2b6bc1dc4 by Victor Stinner in 
branch 'master':
bpo-40513: Per-interpreter GIL (GH-19943)
https://github.com/python/cpython/commit/7be4e350aadf93c4be5c97b7291d0db2b6bc1dc4


--

___
Python tracker 

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



[issue40523] Weakref proxy missing pass throughs for hash() and reversed()

2020-05-05 Thread Raymond Hettinger


New submission from Raymond Hettinger :

from weakref import proxy

class Alpha:
def __len__(self):
return 3
def __reversed__(self):
return iter('cba')
def __hash__(self):
return hash('abc')

a = Alpha()

# Direct use of the instance works
print(len(a))
print(list(reversed(a)))
print(hash(a))

# Proxies can use the dunder methods directly
r = proxy(a)
print(r.__len__())
print(list(r.__reversed__()))
print(r.__hash__())

# Proxy fails for __reversed__ and __hash__
print(len(r), 'This succeeds')
try:
print(list(reversed(r)))
except TypeError:
print('reverse(r) failed')
try:
print(hash(r))
except TypeError:
print('hash(r) failed')

--
components: Library (Lib)
messages: 368197
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Weakref proxy missing pass throughs for hash() and reversed()
type: behavior
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue40524] Print() issue

2020-05-05 Thread Code436


Change by Code436 :


--
components: Regular Expressions
files: Python bug.png
nosy: Coder436, ezio.melotti, mrabarnett
priority: normal
severity: normal
status: open
title: Print() issue
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file49125/Python bug.png

___
Python tracker 

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



[issue40524] Print() issue

2020-05-05 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is not the place to ask for help programming with python. What you're 
seeing is that your attribute_set or attribute_names mapping are missing 
whatever data you think should be present.

I suggest you ask for help on the python-list or python-tutor mailing lists:

https://mail.python.org/mailman/listinfo/python-list
https://mail.python.org/mailman/listinfo/tutor

--
components:  -Regular Expressions
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4e01946cafca0cf49f796c3118e0d65237bcad69 by Victor Stinner in 
branch 'master':
bpo-40513: Per-interpreter signals pending (GH-19924)
https://github.com/python/cpython/commit/4e01946cafca0cf49f796c3118e0d65237bcad69


--

___
Python tracker 

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



[issue40517] Syntax highlighting for ASDL

2020-05-05 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


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

___
Python tracker 

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



[issue40514] Add --experimental-isolated-subinterpreters build option

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



[issue40520] port the declartions in pydebug.h to initconfig.h

2020-05-05 Thread hai shi


New submission from hai shi :

Nick left a comment in `pydebug.h`
/* These global variable are defined in pylifecycle.c */
/* XXX (ncoghlan): move these declarations to pylifecycle.h? */

I have checked those global variables are not only debug variables and they are 
defined in `Python/initconfig.c` now.
If I understand clearly, those declarations should moved to 
`Include/cpython/initconfig.h` and `pydebug.h` could be deleted.

ref: 
https://github.com/python/cpython/commit/d600951748d7a19cdb3e58a376c51ed804b630e6

--
components: Interpreter Core
messages: 368158
nosy: ncoghlan, shihai1991, vstinner
priority: normal
severity: normal
status: open
title: port the declartions in pydebug.h to initconfig.h
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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4e30ed3af06ae655f4cb8aad8cba21f341384250 by Victor Stinner in 
branch 'master':
bpo-40513: Per-interpreter recursion_limit (GH-19929)
https://github.com/python/cpython/commit/4e30ed3af06ae655f4cb8aad8cba21f341384250


--

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 299b8c61e9d1a42b929b8deb1b05067876e191e6 by Victor Stinner in 
branch 'master':
Revert "bpo-40513: Per-interpreter signals pending (GH-19924)" (GH-19932)
https://github.com/python/cpython/commit/299b8c61e9d1a42b929b8deb1b05067876e191e6


--

___
Python tracker 

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



[issue40521] Make tuple, dict, frame free lists, unicode interned strings, unicode latin1 singletons per-interpreter

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue40514] Add --experimental-isolated-subinterpreters build option

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset c5fa364f4ea836f25dd07cfb328152d40a568371 by Victor Stinner in 
branch 'master':
bpo-40514: Add --with-experimental-isolated-subinterpreters (GH-19926)
https://github.com/python/cpython/commit/c5fa364f4ea836f25dd07cfb328152d40a568371


--

___
Python tracker 

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



[issue40417] PyImport_ReloadModule emits deprecation warning

2020-05-05 Thread Robert Rouhani


Change by Robert Rouhani :


--
pull_requests: +19250
pull_request: https://github.com/python/cpython/pull/19935

___
Python tracker 

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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Miguel


New submission from Miguel :

Hello, this is my first python bug report!

I've been running builds of Python 3.7.x on CentOS Linux release 7.7 
(64bit/Intel Core
2 Duo) 
and I ran into hangs with test_ssl.py when using latest SSL 1.1.1d sources.

I've done a full compilation from source for Python 3.7.7 and SSL 1.1 in my
workspaces.

>From what I can tell the problem is when SSL 1.1 is built with no threading
there is no locking enabled by python.

This one line change will make the hangs in test_ssl.py  go away:

Index: Modules/_ssl.c

--- Modules/_ssl.c  (revision 70)
+++ Modules/_ssl.c  (working copy)
@@ -5875,7 +5875,7 @@
 if (!_setup_ssl_threads()) {
 return NULL;
 }
-#elif OPENSSL_VERSION_1_1 && defined(OPENSSL_THREADS)
+#elif OPENSSL_VERSION_1_1
 / OpenSSL 1.1.0 builtin thread support is enabled /
 _ssl_locks_count++;

# endif

There appears to be an assumption in _ssl.c and test_ssl.y that SSL 1.1 will be
threaded
but this may not be true (as in my case).

Appreciate any feedback. Thanks!

--
assignee: christian.heimes
components: SSL
messages: 368143
nosy: christian.heimes, mig28suarez
priority: normal
severity: normal
status: open
title: test_ssl.py hangs with SSL 1.1 built with no threads
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue40518] ValueError when using resource.setrlimit on macOS Catalina

2020-05-05 Thread Shota Iwamoto


New submission from Shota Iwamoto :

Hello, I'm having trouble when using `resource.setrlimit` on macOS.

```
import resource
resource.setrlimit(resource.RLIMIT_STACK, 
resource.getrlimit(resource.RLIMIT_STACK))
```

Running this code gives the following error:

```
Traceback (most recent call last):
  File "main.py", line 2, in 
resource.setrlimit(resource.RLIMIT_STACK, 
resource.getrlimit(resource.RLIMIT_STACK))
ValueError: current limit exceeds maximum limit
```

I ran the same code in my linux environment and it worked.

* macOS Catalina 10.15.4 (19E287)
* `python --version` : Python 3.7.7

Thanks.

--
components: macOS
messages: 368149
nosy: morioprog, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: ValueError when using resource.setrlimit on macOS Catalina
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue40518] ValueError when using resource.setrlimit on macOS Catalina

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



[issue40462] [easy] undefined name in Lib/test/mock_socket.py

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

> IMHO we should create backport patch for 3.8 and 3.7

It's deadcode, I don't think that it's worth it. But it's up to you. If you 
consider that it's worth it, go ahead and backport the fix.

--

___
Python tracker 

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



[issue40520] port the declartions in pydebug.h to initconfig.h

2020-05-05 Thread hai shi


hai shi  added the comment:

Got it, thanks for your explanation, victor ;)

--

___
Python tracker 

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



[issue40521] Make tuple, dict, frame free lists, unicode interned strings, unicode latin1 singletons per-interpreter

2020-05-05 Thread STINNER Victor


New submission from STINNER Victor :

tuple, dict and frame use free lists to optimize the creation of objects.

Unicode uses "interned" strings to reduce the Python memory footprint and 
speedup dictionary lookups.

Unicode also uses singletons for single letter Latin1 characters ([U+; 
U+00FF] range).

All these optimizations are incompatible with isolated subinterpreters, since 
caches are currently shared by all inteprepreters. These caches should be made 
per-intepreter. See bpo-40512 "Meta issue: per-interpreter GIL" for the 
rationale.

I already made small integer singletons per interpreter in bpo-38858:

* commit 5dcc06f6e0d7b5d6589085692b86c63e35e2325e
* commit 630c8df5cf126594f8c1c4579c1888ca80a29d59.

--
components: Interpreter Core
messages: 368175
nosy: vstinner
priority: normal
severity: normal
status: open
title: Make tuple, dict, frame free lists, unicode interned strings, unicode 
latin1 singletons per-interpreter
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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Miguel


Miguel  added the comment:

I built with 'no-threads' option.
I understand if you no longer wish to support non-threaded SSL. 
But it just seemed to me that you could if you protected the SSL API calls with 
locking since I can get all your ssl tests to work with this minor change.

--

___
Python tracker 

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



[issue40520] port the declartions in pydebug.h to initconfig.h

2020-05-05 Thread STINNER Victor


STINNER Victor  added the comment:

Global configuration variables are part of the C API. They are now documented:
https://docs.python.org/dev/c-api/init.html#global-configuration-variables

They are used to populate PyConfig (PEP 587). At startup, the PyConfig is 
copied into these global configuration variables. After the Python 
initilization, they are no longer read, but PyConfig (tstate->interp->config) 
is read instead.

You can simply remove the two lines comment from pydebug.h.

--

___
Python tracker 

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



[issue32117] Tuple unpacking in return and yield statements

2020-05-05 Thread miss-islington


miss-islington  added the comment:


New changeset 627f7012353411590434a7d5777ddcbcc8d97fcd by Javier Buzzi in 
branch 'master':
bpo-32117: Updated Simpsons names in docs (GH-19737)
https://github.com/python/cpython/commit/627f7012353411590434a7d5777ddcbcc8d97fcd


--

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19247
pull_request: https://github.com/python/cpython/pull/19932

___
Python tracker 

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



[issue40520] Remove redundant comment in pydebug.h

2020-05-05 Thread Dong-hee Na


Dong-hee Na  added the comment:

Thanks hai shi :)

--
nosy: +corona10
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



[issue40512] Meta issue: per-interpreter GIL

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



[issue40514] Add --experimental-isolated-subinterpreters build option

2020-05-05 Thread Eric Snow


Eric Snow  added the comment:

It would probably make sense to remove the build option in the 3.9 release.  We 
can leave it in master, but remove it in the 3.9 branch once it has been 
created.

--

___
Python tracker 

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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Christian Heimes


Christian Heimes  added the comment:

It not about what I wish or wish not to do.

Python requires thread-safe libraries. A library without proper locking and 
thread safety is no longer safe to use without great effort and careful locking 
in the glue code. A non-threaded OpenSSL build will lead to memory corruption 
and eventually crash the interpreter.

--

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +19244
pull_request: https://github.com/python/cpython/pull/19929

___
Python tracker 

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



[issue40520] Remove redundant comment in pydebug.h

2020-05-05 Thread hai shi


hai shi  added the comment:

Thanks, Dong-hee Na ;)

--

___
Python tracker 

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



[issue40010] Inefficient signal handling in multithreaded applications

2020-05-05 Thread Eric Snow


Eric Snow  added the comment:

Good catch on this, Victor.  Thanks for doing it.

--
nosy: +eric.snow

___
Python tracker 

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



[issue40516] GCC 9 compiler warnings on MacOS Catalina

2020-05-05 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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

___
Python tracker 

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



[issue40513] Move _PyRuntimeState.ceval to PyInterpreterState

2020-05-05 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue40519] Preserve AttributeError exception context in __getattr__

2020-05-05 Thread Arusekk


New submission from Arusekk :

This is another attempt at issue 39865, but with a different attitude. Please 
see that issue for some extra motivation for this change.

My suggestion is to change getattr logic, which now is (in this case):

def getattr(obj, attr):
try:
return normal_getattr(obj, attr)
except AttributeError:
pass
return obj.__getattr__(attr)

to be more like:

def getattr(obj, attr):
try:
return normal_getattr(obj, attr)
except AttributeError:
return obj.__getattr__(attr)

A __getattr__ function would then be able to know the exception context
(through sys.exc_info()) and to have the context automatically attached to all 
the exceptions raised (still respecting raise ... from None).

This particular issue only lies in Objects/typeobject.c, but is probably valid 
for other uses of PyErr_Clear() in the interpreter.
I checked some using a simple shell pipeline:

$ grep -r -A5 PyErr_ExceptionMatches |grep -C5 PyErr_Clear

And found some interesting examples of what be worth looking into:
Python/sysmodule.c:708
Parser/tokenizer.c:1110
Objects/memoryobject.c:fix_error_int

I prepared two patches for this (please forgive if I violated code style 
somewhere, I am not saying that they are a final version ready to be merged): a 
simple one, addressing just this very issue, and a robust one, allowing other 
places (e.g. from the list above) to reuse it.

--
components: Interpreter Core
files: typeobject.patch
keywords: patch
messages: 368152
nosy: Arusekk, ammar2, pasenor
priority: normal
severity: normal
status: open
title: Preserve AttributeError exception context in __getattr__
type: behavior
versions: Python 3.9
Added file: https://bugs.python.org/file49122/typeobject.patch

___
Python tracker 

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



[issue40520] Remove redundant comment in pydebug.h

2020-05-05 Thread Dong-hee Na


Change by Dong-hee Na :


--
title: port the declartions in pydebug.h to initconfig.h -> Remove redundant 
comment in pydebug.h

___
Python tracker 

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



[issue40520] port the declartions in pydebug.h to initconfig.h

2020-05-05 Thread miss-islington


miss-islington  added the comment:


New changeset 6351d9e4400a77fe1fcbe4f03e5fb6620cca236d by Hai Shi in branch 
'master':
bpo-40520: Remove redundant comment in pydebug.h (GH-19931)
https://github.com/python/cpython/commit/6351d9e4400a77fe1fcbe4f03e5fb6620cca236d


--
nosy: +miss-islington

___
Python tracker 

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



[issue40379] multiprocessing's default start method of fork()-without-exec() is broken

2020-05-05 Thread Itamar Turner-Trauring


Itamar Turner-Trauring  added the comment:

Just got an email from someone for whom switching to "spawn" fixed a problem. 
Earlier this week someone tweeted about this fixing things. This keeps hitting 
people in the real world.

--

___
Python tracker 

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



[issue40516] GCC 9 compiler warnings on MacOS Catalina

2020-05-05 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

Building master with GCC 9.3.0 gives some warnings on posix and nis:

./Modules/posixmodule.c: In function 'os_chown_impl':
./Modules/posixmodule.c:3397:39: warning: the comparison will always evaluate 
as 'false' for the address of 'lchown' will never be NULL [-Waddress]
 3397 | if ((!follow_symlinks) && (lchown == NULL)) {
  |   ^~
./Modules/posixmodule.c: In function 'PyInit_posix':
./Modules/posixmodule.c:14939:16: warning: the comparison will always evaluate 
as 'false' for the address of 'lchown' will never be NULL [-Waddress]
14939 | if (lchown == NULL) {
  |^~
/Users/remi/src/cpython/Modules/nismodule.c: In function 'nis_cat':
/Users/remi/src/cpython/Modules/nismodule.c:216:18: warning: cast between 
incompatible function types from 'int (*)(int,  char *, int,  char *, int,  
struct ypcallback_data *)' to 'int (*)(long unsigned int,  char *, int,  char 
*, int,  void *)' [-Wcast-function-type]
  216 | cb.foreach = (foreachfunc)nis_foreach;
  |  ^
/Users/remi/src/cpython/Modules/nismodule.c: In function 'nis_xdr_ypmaplist':
/Users/remi/src/cpython/Modules/nismodule.c:302:42: warning: cast between 
incompatible function types from 'int (*)(XDR *, nismaplist *)' {aka 'int 
(*)(struct __rpc_xdr *, struct nismaplist *)'} to 'int (*)(XDR *, void *, 
unsigned int)' {aka 'int (*)(struct __rpc_xdr *, void *, unsigned int)'} 
[-Wcast-function-type]
  302 |  sizeof(nismaplist), (xdrproc_t)nis_xdr_ypmaplist))
  |  ^
/Users/remi/src/cpython/Modules/nismodule.c: In function 
'nis_xdr_ypresp_maplist':
/Users/remi/src/cpython/Modules/nismodule.c:328:42: warning: cast between 
incompatible function types from 'int (*)(XDR *, nismaplist *)' {aka 'int 
(*)(struct __rpc_xdr *, struct nismaplist *)'} to 'int (*)(XDR *, void *, 
unsigned int)' {aka 'int (*)(struct __rpc_xdr *, void *, unsigned int)'} 
[-Wcast-function-type]
  328 |  sizeof(nismaplist), (xdrproc_t)nis_xdr_ypmaplist))
  |  ^
In file included from 
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/rpc/rpc.h:76,
 from /Users/remi/src/cpython/Modules/nismodule.c:17:
/Users/remi/src/cpython/Modules/nismodule.c: In function 'nisproc_maplist_2':
/Users/remi/src/cpython/Modules/nismodule.c:344:19: warning: cast between 
incompatible function types from 'int (*)(XDR *, char **)' {aka 'int (*)(struct 
__rpc_xdr *, char **)'} to 'int (*)(XDR *, void *, unsigned int)' {aka 'int 
(*)(struct __rpc_xdr *, void *, unsigned int)'} [-Wcast-function-type]
  344 |   (xdrproc_t)nis_xdr_domainname, (caddr_t)argp,
  |   ^
/Users/remi/src/cpython/Modules/nismodule.c:345:19: warning: cast between 
incompatible function types from 'int (*)(XDR *, nisresp_maplist *)' {aka 'int 
(*)(struct __rpc_xdr *, struct nisresp_maplist *)'} to 'int (*)(XDR *, void *, 
unsigned int)' {aka 'int (*)(struct __rpc_xdr *, void *, unsigned int)'} 
[-Wcast-function-type]
  345 |   (xdrproc_t)nis_xdr_ypresp_maplist, (caddr_t),
  |   ^


I'm not sure about the fix, especially for nis but I will propose a PR. There 
is also some warnings concerning libffi_osx but this looks like a vendored 
dependency so I left it untouched.

--
components: Build
messages: 368146
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: GCC 9 compiler warnings on MacOS Catalina
type: behavior

___
Python tracker 

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



[issue40515] test_ssl.py hangs with SSL 1.1 built with no threads

2020-05-05 Thread Christian Heimes


Christian Heimes  added the comment:

How did you build OpenSSL 1.1.1d? Python assumes default build of OpenSSL. 
Since Python is now always multi-threaded we no longer support non-threaded 
OpenSSL builds.

--
versions:  -Python 3.5, Python 3.6, Python 3.8, Python 3.9

___
Python tracker 

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



  1   2   >