[issue38382] statistics.harmonic_mean fails to raise error with negative input that follows a 0

2019-10-07 Thread Warren Weckesser


Warren Weckesser  added the comment:

I really don't like the current inconsistent behavior.  I can't help but see it 
as a bug, and I am surprised that folks think it is OK that harmonic_mean([0, 
"foo"]) returns 0.  This is the *statistics* module, and the first line of 
https://docs.python.org/3/library/statistics.html says "This module provides 
functions for calculating mathematical statistics of numeric (Real-valued) 
data".  I understand the desire to maintain the performance benefit of the 
early exit, but I would rather disallow values that are zero than accept the 
nonsensical result of harmonic_mean([0, "foo"]) and the inconsistency between 
that and the result of harmonic_mean(["foo", 0]).  I spend most of my time 
working on numerical-ish code, so my world view might be different than that of 
y'all.

Here's a new proposal.  To continue to accept zero values, and disallow 
negative values consistently (as the function is documented to do), *and* 
preserve the early exit, I propose that the try/except statement in 
harmonic_mean in master be changed to

try:
T, total, count = _sum(1/x for x in _fail_neg(data, errmsg))
except ZeroDivisionError:
if any(x < 0 for x in data):
raise StatisticsError(errmsg) from None
return 0

The change adds just the two lines in the except block.  This doesn't change 
the "happy path" that is followed when all the values are strictly greater than 
0.  The cost of the additional check for any negative values in the input only 
occurs in the (presumably uncommon) case where an input value is 0.  (This 
means, however, that any values before the first 0 are checked twice.)

> In the original design, I prohibited negative numbers because that seems to 
> be what everyone says you should do, but as far as I can tell it is 
> mathematically well defined so long as the sum of positive values doesn't 
> equal the sum of negative values. And in that case, we could return a NAN.

Allowing negative values introduces some mathematical issues.  Most 
importantly, the limit of the harmonic mean as two or more values approach zero 
(in the multivariable limit sense) no longer exists.  Even in the simple case 
of computing the harmonic mean H(x, y) of two values, the limit of H(x, y) as 
(x, y) -> (0, 0) does not exist. H(x, y) is one of those funky functions where 
there are different paths to the origin in the second and fourth quadrants that 
lead to different values of the limit.  Of course, practicality beats purity, 
so the harmonic mean could simply be defined to be 0 whenever any one of the 
inputs is 0.  Then the only issue is the one you mentioned: the handling of the 
case where the denominator of the harmonic mean formula is zero.  In that case, 
the code would return NAN as you suggested, or raise an exception.  Overall, I 
don't think handling negative values is very important, and I'm not sure such a 
change to the function is worthwhile.  On the other hand, I t
 hink it would be better than the current behavior.

> By the way, I've just noticed that harmonic_mean([INF, INF]) raises. Should 
> it return INF instead?

Yes, I expect INF in that case.  Currently it only raises when all the inputs 
are INF.  Include one finite value, and there is no error:

In [67]: harmonic_mean([math.inf, math.inf, 5])
Out[67]: 15.0

The exception could be fixed by checking if total is zero before computing 
n/total (currently computed in the return statement of the function).

--

___
Python tracker 

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



[issue14364] Argparse incorrectly handles '--' as argument to option

2019-10-07 Thread hai shi


hai shi  added the comment:

> The PR's Misc/NEWS entry, "Fix behavior of argparse when '--' as argument to 
> option", is insufficient.

Thanks for your comment, Raymond. I would continue update the desc.

--

___
Python tracker 

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



[issue25988] collections.abc.Indexable

2019-10-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset ef092fe9905f61ca27889092ca1248a11aa74498 by Serhiy Storchaka in 
branch 'master':
bpo-25988: Do not expose abstract collection classes in the collections module. 
(GH-10596)
https://github.com/python/cpython/commit/ef092fe9905f61ca27889092ca1248a11aa74498


--

___
Python tracker 

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



[issue38390] Got an compile warning in dictobject.c

2019-10-07 Thread hai shi

New submission from hai shi :

The warning detail:

Objects/dictobject.c: In function ‘_PyDictView_Intersect’:
Objects/dictobject.c:4189:15: warning: unused variable ‘tmp’ [-Wunused-variable]
 PyObject *tmp;
   ^

--
components: Build
messages: 354068
nosy: shihai1991
priority: normal
severity: normal
status: open
title: Got an compile warning in dictobject.c
type: compile error
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



[issue38390] Got a compile warning in dictobject.c

2019-10-07 Thread hai shi


Change by hai shi :


--
title: Got an compile warning in dictobject.c -> Got a compile warning in 
dictobject.c

___
Python tracker 

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



[issue38215] Do not import modules in star-import when __all__ is not defined.

2019-10-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue38390] Got a compile warning in dictobject.c

2019-10-07 Thread hai shi


Change by hai shi :


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

___
Python tracker 

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



[issue38391] Typo in tutorial code (does not compile)

2019-10-07 Thread Loïc Etienne

New submission from Loïc Etienne :

https://docs.python.org/3.7/extending/newtypes_tutorial.html

Is: PY_DECREF(m);
Should be: Py_DECREF(m);

--
components: Demos and Tools
messages: 354069
nosy: Loïc Etienne
priority: normal
severity: normal
status: open
title: Typo in tutorial code (does not compile)
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



[issue38210] Intersection of dict view with iterator returns empty set

2019-10-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16199
pull_request: https://github.com/python/cpython/pull/16611

___
Python tracker 

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



[issue38376] ./configure --with-assertions generates a broken build

2019-10-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16201
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16612

___
Python tracker 

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



[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-10-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16202
pull_request: https://github.com/python/cpython/pull/16613

___
Python tracker 

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



[issue38376] ./configure --with-assertions generates a broken build

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

My intent in bpo-36389 was to also provide _PyObject_CheckConsistency() in 
release mode to help debugging GC crash, especially in visit_decref(). I wrote 
PR 16612 to fix my implementation.

--

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-10-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16200
pull_request: https://github.com/python/cpython/pull/16612

___
Python tracker 

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



[issue28869] __module__ attribute is not set correctly for a class created by direct metaclass call

2019-10-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is a simpler way to fix this issue. Instead of hacking __new__, the 
inheritance registry can be set up in ABCMeta.__init__. There are no reasons of 
making this in __new__.

--
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 3.4, Python 3.5, Python 
3.6

___
Python tracker 

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



[issue38390] Got a compile warning in dictobject.c

2019-10-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue38353] Cleanup the path configuration implementation code (getpath.c)

2019-10-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16203
pull_request: https://github.com/python/cpython/pull/16614

___
Python tracker 

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



[issue25988] collections.abc.Indexable

2019-10-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue38210] Intersection of dict view with iterator returns empty set

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d97f1ce6dba6c4aa5614adc06ad2e0948709845c by Victor Stinner in 
branch 'master':
bpo-38210: Fix compiler warning in dictobject.c (GH-16611)
https://github.com/python/cpython/commit/d97f1ce6dba6c4aa5614adc06ad2e0948709845c


--
nosy: +vstinner

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

Update: I added an assertion which should help to detect some kind of bugs in 
debug mode:

commit d91d4de31745fc1ed4c7e6c208917827c9c472b6
Author: Victor Stinner 
Date:   Mon Sep 9 17:44:59 2019 +0200

bpo-38070: visit_decref() calls _PyObject_IsFreed() (GH-15782)

In debug mode, visit_decref() now calls _PyObject_IsFreed() to ensure
that the object is not freed. If it's freed, the program fails with
an assertion error and Python dumps informations about the freed
object.

--

___
Python tracker 

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



[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread STINNER Victor


New submission from STINNER Victor :

A bug in Python/hamt.c was only discovered 4 months after the code was added to 
Python:
* https://mail.python.org/pipermail/python-dev/2018-June/153857.html
* https://bugs.python.org/issue33803

The problem was that an object was tracked by the GC, whereas calling its 
traverse method crashed Python... depending when the traverse method is called 
exactly.

Pseudo-code:

  PyObject_GC_Track();
  ...
  obj2 = PyObject_GC_NewVar(...);
  ...
  

The problem is that PyObject_GC_NewVar() can trigger a GC collection which uses 
the partially initialized object, and then we get a cryptic crash in the GC 
(usually seen in visit_decref()).

I propose to make PyObject_GC_Track() stricter: validate that the object seems 
to be "valid" or "fully initialized". From the GC point of view, it means that 
calling tp_traverse must not crash.

Attached PR is a concrete implementation.

This issue is a follow-up of my previously failed attempt bpo-36389 "Add 
gc.enable_object_debugger(): detect corrupted Python objects in the GC". While 
bpo-36389 attempts to discoverd corrupted objects once a GC collection is 
triggered, this issue is restricted to objects entering the GC.

First problem: my PR breaks Modules/pyexpat.c whereas the code is not strictly 
a bug: in Python 3.8, it's ok to put a partially initialized object into the GC 
if no GC collection can be triggered before the object is fully initialized. In 
Modules/pyexpat.c case, the code looks safe from that point of view.

It means that such change is a backward incompatible change. IMHO it's a good 
step forward, since it is likely to discovered hidden bugs.

--
components: Interpreter Core
messages: 354074
nosy: vstinner
priority: normal
severity: normal
status: open
title: Ensure that objects entering the GC are valid
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



[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

Pablo, Tim, Neal: what do you think of this idea?

--
nosy: +nnorwitz, pablogsal, tim.peters
stage: patch review -> 

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

I created bpo-38392 "Ensure that objects entering the GC are valid".

--

___
Python tracker 

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



[issue38353] Cleanup the path configuration implementation code (getpath.c)

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b96145a6b5d89599ebccd2111d93f5670ddae840 by Victor Stinner in 
branch 'master':
bpo-38353: Simplify calculate_pybuilddir() (GH-16614)
https://github.com/python/cpython/commit/b96145a6b5d89599ebccd2111d93f5670ddae840


--

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, regrtest main process was killed by faulthandler watchdog: it was blocked 
in _get_result() for longer than 1 minute.

Extract of _get_result():

use_faulthandler = (self.ns.timeout is not None)
timeout = PROGRESS_UPDATE
while True:
if use_faulthandler:
faulthandler.dump_traceback_later(timeout * 2.0, exit=True)

# wait for a thread
try:
return self.output.get(timeout=timeout)
except queue.Empty:
pass

# display progress
running = get_running(self.workers)
if running and not self.ns.pgo:
self.log('running: %s' % ', '.join(running))

self.ns.timeout is supposed to be 1500.

I don't understand why regrtest got a timeout of 60 seconds?

https://buildbot.python.org/all/#/builders/168/builds/1583

LD_LIBRARY_PATH=/usr/home/buildbot/python/3.x.koobs-freebsd-current/build 
./python  ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest 
--fail-env-changed --timeout=1500 -j2 -j4 
== CPython 3.9.0a0 (heads/master:ed8efd8e2c, Oct 7 2019, 21:38:27) [Clang 8.0.1 
(tags/RELEASE_801/final 366581)]
== FreeBSD-13.0-CURRENT-amd64-64bit-ELF little-endian
== cwd: 
/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/build/test_python_67537
== CPU count: 4
== encodings: locale=UTF-8, FS=utf-8
Using random seed 1307598
0:00:00 load avg: 3.41 Run tests in parallel using 4 child processes
(...)
0:00:11 load avg: 3.55 [ 12/419] test_extcall passed
0:00:13 load avg: 3.55 [ 13/419] test_pydoc passed
0:00:14 load avg: 3.55 [ 14/419] test_devpoll skipped
test_devpoll skipped -- test works only on Solaris OS family
0:00:15 load avg: 3.55 [ 15/419] test_class passed
0:00:17 load avg: 3.50 [ 16/419] test_ntpath passed
Timeout (0:01:00)!
Thread 0x000802d30c00 (most recent call first):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/selectors.py", 
line 415 in select
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/subprocess.py", 
line 1964 in _communicate
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/subprocess.py", 
line 1113 in communicate
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest_mp.py",
 line 199 in _run_process
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest_mp.py",
 line 228 in _runtest
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest_mp.py",
 line 265 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 944 in _bootstrap_inner
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 902 in _bootstrap

Thread 0x000802d2fd00 (most recent call first):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/selectors.py", 
line 415 in select
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/subprocess.py", 
line 1964 in _communicate
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/subprocess.py", 
line 1113 in communicate
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest_mp.py",
 line 199 in _run_process
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest_mp.py",
 line 228 in _runtest
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest_mp.py",
 line 265 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 944 in _bootstrap_inner
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 902 in _bootstrap

Thread 0x000802d2f800 (most recent call first):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/selectors.py", 
line 415 in select
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/subprocess.py", 
line 1964 in _communicate
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/subprocess.py", 
line 1113 in communicate
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest_mp.py",
 line 199 in _run_process
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest_mp.py",
 line 228 in _runtest
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/libregrtest/runtest_mp.py",
 line 265 in run
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 944 in _bootstrap_inner
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/threading.py", 
line 902 in _bootstrap

Thread 0x000802d30200 (most recent call first):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/selectors.py", 
line 415 in select
  File 
"/usr/home/bu

[issue38323] test_ayncio: test_close_kill_running() hangs on AMD64 RHEL7 Refleaks 3.x

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

Fail on x86 Gentoo Refleaks 3.x:
https://buildbot.python.org/all/#/builders/1/builds/737

(...)
Loop <_UnixSelectorEventLoop running=False closed=True debug=False> that 
handles pid 8654 is closed
.Timeout (3:15:00)!
Thread 0xb7b92700 (most recent call first):
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/selectors.py",
 line 468 in select
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/asyncio/base_events.py",
 line 1837 in _run_once
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/asyncio/base_events.py",
 line 589 in run_forever
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/asyncio/base_events.py",
 line 621 in run_until_complete
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/test_asyncio/test_subprocess.py",
 line 484 in test_close_kill_running
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/case.py",
 line 616 in _callTestMethod
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/case.py",
 line 659 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/case.py",
 line 719 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/support/testresult.py",
 line 162 in run
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/support/__init__.py",
 line 2032 in _run_suite
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/support/__init__.py",
 line 2128 in run_unittest
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/runtest.py",
 line 209 in _test_module
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/refleak.py",
 line 87 in dash_R
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/runtest.py",
 line 232 in _runtest_inner2
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/runtest.py",
 line 270 in _runtest_inner
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/runtest.py",
 line 153 in _runtest
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/runtest.py",
 line 193 in runtest
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/runtest_mp.py",
 line 67 in run_tests_worker
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/main.py",
 line 654 in _main
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/main.py",
 line 634 in main
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/libregrtest/main.py",
 line 712 in main
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/regrtest.py",
 line 43 in _main
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/test/regrtest.py",
 line 47 in 
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/runpy.py", 
line 85 in _run_code
  File 
"/buildbot/buildarea/cpython/3.x.ware-gentoo-x86.refleak/build/Lib/runpy.py", 
line 192 in _run_module_as_main

== Tests result: FAILURE ==

410 tests OK.

10 slowest tests:
- test_concurrent_futures: 23 min 2 sec
- test_multiprocessing_spawn: 22 min 6 sec
- test_multiprocessing_forkserver: 15 min 51 sec
- test_multiprocessing_fork: 10 min 15 sec
- test_regrtest: 10 min 10 sec
- test_gdb: 8 min 26 sec
- test_lib2to3: 7 min 31 sec
- test_pickle: 7 min
- test_io: 6 min 50 sec
- test_subprocess: 6 min 37 sec

1 test failed:
test_asyncio

8 tests skipped:
test_devpoll test

[issue38391] Typo in tutorial code (does not compile)

2019-10-07 Thread Krishna Oza


Change by Krishna Oza :


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

___
Python tracker 

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



[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread Thomas Wouters


Thomas Wouters  added the comment:

I'm pretty sure you meant nascheme, not nnorwitz.

--
nosy: +nascheme, twouters -nnorwitz

___
Python tracker 

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



[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It could be possible to do this in backward compatible way. PyObject_GC_Track() 
could add the object to the list of new objects (all objects are already linked 
in bi-linked list, so it would need to just move the object to the specified 
list), and PyObject_GC_NewVar() could check all new objects and clear the list 
of new objects (just move the head).

I am not sure it is worth to do such complication.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

>From documentation:

.. c:function:: void PyObject_GC_Track(PyObject *op)

   Adds the object *op* to the set of container objects tracked by the
   collector.  The collector can run at unexpected times so objects must be
   valid while being tracked.  This should be called once all the fields
   followed by the :c:member:`~PyTypeObject.tp_traverse` handler become valid, 
usually near the
   end of the constructor.

So there was a bug in Modules/pyexpat.c.

--

___
Python tracker 

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



[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

> I'm pretty sure you meant nascheme, not nnorwitz.

Oops, right :-)

--

___
Python tracker 

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



[issue38391] Typo in tutorial code (does not compile)

2019-10-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16206
pull_request: https://github.com/python/cpython/pull/16618

___
Python tracker 

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



[issue38391] Typo in tutorial code (does not compile)

2019-10-07 Thread Xiang Zhang


Xiang Zhang  added the comment:


New changeset 038503e08ac5b10601b95d5adc2c2cab7be10163 by Xiang Zhang (Krishna 
Oza) in branch 'master':
bpo-38391: Fixing a typo for Py_DECREF (GH-16616)
https://github.com/python/cpython/commit/038503e08ac5b10601b95d5adc2c2cab7be10163


--
nosy: +xiang.zhang

___
Python tracker 

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



[issue38391] Typo in tutorial code (does not compile)

2019-10-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16207
pull_request: https://github.com/python/cpython/pull/16619

___
Python tracker 

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



[issue38392] Ensure that objects entering the GC are valid

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

> It could be possible to do this in backward compatible way. 
> PyObject_GC_Track() could add the object to the list of new objects (all 
> objects are already linked in bi-linked list, so it would need to just move 
> the object to the specified list), and PyObject_GC_NewVar() could check all 
> new objects and clear the list of new objects (just move the head).

That's different than what I'm proposing here. Checking "later" is more on the 
bpo-36389 side: my bpo-36389 PR modified PyObject_GC_NewVar() to check that 
young object are valid.

Moreover, my bpo-36389 PR required threshold: checking all young objects at 
each PyObject_GC_NewVar() simply killed performance which made the whole 
approach unusable in practice. Because of the threshold, my implementation 
failed to detect the hamt.c bug bpo-33803: the partially initialized was 
already fully initialized when my "object debugger" ran. PR 16615 detects 
immediately the hamt.c bug bpo-33803.

I designed bpo-36389 to attempt to detect when an object is corrupted after its 
creation, corrupted by code running "later".

We had a customer with a bug in OpenStack Nova. Nova crashed in visit_decref() 
but I failed to debug the issue. It motivated me to modify the debug ABI in 
Python 3.8, so later it will become possible to switch from release to debug 
mode to attempt to debug a program using additional checks added by the debug 
build.

Here my intent is to ensure that objects entering the GC are valid to help to 
keep the GC list consistent and valid. But it doesn't prevent an object from 
being corrupted after its creation. We should try to find a different approach 
for that (maybe revisit bpo-36389).

--

___
Python tracker 

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



[issue38391] Typo in tutorial code (does not compile)

2019-10-07 Thread miss-islington


miss-islington  added the comment:


New changeset 985ec986e864b670687b900a4d6ca977b4e9694d by Miss Islington (bot) 
in branch '3.8':
bpo-38391: Fixing a typo for Py_DECREF (GH-16616)
https://github.com/python/cpython/commit/985ec986e864b670687b900a4d6ca977b4e9694d


--

___
Python tracker 

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



[issue38391] Typo in tutorial code (does not compile)

2019-10-07 Thread miss-islington


miss-islington  added the comment:


New changeset 77b4a659b60536caf11c547332d30677f3e8f02e by Miss Islington (bot) 
in branch '3.7':
bpo-38391: Fixing a typo for Py_DECREF (GH-16616)
https://github.com/python/cpython/commit/77b4a659b60536caf11c547332d30677f3e8f02e


--
nosy: +miss-islington

___
Python tracker 

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



[issue37531] Fix regrtest timeout for subprocesses: regrtest -jN --timeout=SECONDS

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

> I don't understand why regrtest got a timeout of 60 seconds?

Oh, that comes from "timeout = PROGRESS_UPDATE" with "PROGRESS_UPDATE = 30.0".

But it means that the main process was stuck for longer than 60 seconds!?

The main process is supposed to write an update "running: ..." every 30 seconds.

This buildbot is very slow. Maybe 30 and 60 seconds limits are too low?

--

___
Python tracker 

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



[issue38391] Typo in tutorial code (does not compile)

2019-10-07 Thread Xiang Zhang


Change by Xiang Zhang :


--
assignee:  -> docs@python
components: +Documentation -Demos and Tools
nosy: +docs@python
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue26219] implement per-opcode cache in ceval

2019-10-07 Thread Mark Shannon


Mark Shannon  added the comment:

"What's new in Python 3.8" says that this change speeds up the LOAD_GLOBAL 
opcode by 40%.
That seems meaningless as a program cannot have LOAD_GLOBAL in isolation so any 
test would have other bytecodes as well.

What's the evidence for the claimed speedup?
What's the speedup on the benchmark suite?

--
nosy: +Mark.Shannon

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

> What's the evidence for the claimed speedup?
> What's the speedup on the benchmark suite?

https://github.com/python/cpython/pull/12884#issuecomment-485091040
points to:
https://github.com/methane/sandbox/tree/master/2019/opcache_load_global#opcache-for-load_global

== Microbenchmark ==

$ master/python -m perf timeit -s 'def foo(): int; str; bytes; float; int; str; 
bytes; float' -- 'foo()'
.
Mean +- std dev: 213 ns +- 5 ns

$ opcache/python -m perf timeit -s 'def foo(): int; str; bytes; float; int; 
str; bytes; float' -- 'foo()'
.
Mean +- std dev: 120 ns +- 2 ns

== pyperformance ==

$ ./cpython/python -m perf compare_to master.json opcache_load_global.json -G  
--min-speed=2
Slower (2):
- pickle: 19.1 us +- 0.2 us -> 19.7 us +- 0.8 us: 1.03x slower (+3%)
- unpickle_list: 8.66 us +- 0.04 us -> 8.85 us +- 0.06 us: 1.02x slower (+2%)

Faster (23):
- scimark_lu: 424 ms +- 22 ms -> 384 ms +- 4 ms: 1.10x faster (-9%)
- regex_compile: 359 ms +- 4 ms -> 330 ms +- 1 ms: 1.09x faster (-8%)
- django_template: 250 ms +- 3 ms -> 231 ms +- 2 ms: 1.08x faster (-8%)
- unpickle_pure_python: 802 us +- 12 us -> 754 us +- 9 us: 1.06x faster (-6%)
- pickle_pure_python: 1.04 ms +- 0.01 ms -> 991 us +- 15 us: 1.05x faster (-5%)
- hexiom: 20.8 ms +- 0.2 ms -> 19.8 ms +- 0.1 ms: 1.05x faster (-5%)
- logging_simple: 18.4 us +- 0.2 us -> 17.6 us +- 0.2 us: 1.05x faster (-4%)
- sympy_expand: 774 ms +- 5 ms -> 741 ms +- 3 ms: 1.04x faster (-4%)
- json_dumps: 28.1 ms +- 0.2 ms -> 27.0 ms +- 0.2 ms: 1.04x faster (-4%)
- logging_format: 20.4 us +- 0.2 us -> 19.6 us +- 0.3 us: 1.04x faster (-4%)
- richards: 147 ms +- 2 ms -> 141 ms +- 1 ms: 1.04x faster (-4%)
- meteor_contest: 189 ms +- 1 ms -> 182 ms +- 1 ms: 1.04x faster (-4%)
- xml_etree_iterparse: 226 ms +- 2 ms -> 217 ms +- 2 ms: 1.04x faster (-4%)
- sympy_str: 358 ms +- 3 ms -> 345 ms +- 4 ms: 1.04x faster (-4%)
- sqlalchemy_imperative: 44.0 ms +- 1.2 ms -> 42.4 ms +- 1.2 ms: 1.04x faster 
(-4%)
- sympy_sum: 167 ms +- 1 ms -> 161 ms +- 1 ms: 1.04x faster (-4%)
- nqueens: 217 ms +- 1 ms -> 211 ms +- 1 ms: 1.03x faster (-3%)
- fannkuch: 1.09 sec +- 0.01 sec -> 1.07 sec +- 0.00 sec: 1.03x faster (-3%)
- raytrace: 1.11 sec +- 0.02 sec -> 1.08 sec +- 0.01 sec: 1.03x faster (-3%)
- dulwich_log: 122 ms +- 1 ms -> 119 ms +- 1 ms: 1.03x faster (-3%)
- logging_silent: 419 ns +- 5 ns -> 410 ns +- 5 ns: 1.02x faster (-2%)
- sympy_integrate: 33.5 ms +- 0.1 ms -> 32.8 ms +- 0.2 ms: 1.02x faster (-2%)
- pathlib: 40.8 ms +- 0.4 ms -> 40.0 ms +- 0.5 ms: 1.02x faster (-2%)

Benchmark hidden because not significant (32): (...)

--

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2019-10-07 Thread Mark Shannon


Mark Shannon  added the comment:

Given that
def foo(): int; str; bytes; float; int; str; bytes; float
can be trivially be rewritten as
def foo(): pass
I think that benchmark is meaningless.

I really don't think we should be making claims like "40% speedup" for such 
contrived examples.

It looks like the speedup is real, but only about 2% speedup overall.
The "what's new" should reflect that, IMO.

--

___
Python tracker 

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



[issue37324] collections: remove deprecated aliases to ABC classes

2019-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I think this can be closed since https://bugs.python.org/issue25988 has the PR 
merged.

--
nosy: +serhiy.storchaka, xtreak

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The removal was done in https://bugs.python.org/issue25988 . Given that the 
version in warning message was updated I guess this can be closed.

--

___
Python tracker 

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



[issue37324] collections: remove deprecated aliases to ABC classes

2019-10-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> collections.abc.Indexable

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-10-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue36953] Remove collections ABCs?

2019-10-07 Thread Chih-Hsuan Yen


Chih-Hsuan Yen  added the comment:

Lib/collections/__init__.py on branch 3.7 still states:

> Using or importing the ABCs from 'collections' instead of from 
> 'collections.abc' is deprecated, and in 3.8 it will stop working

I think it should also be updated (hopefully before 3.7.5?) as the actual 
removal turns out to be in 3.9.

--

___
Python tracker 

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



[issue38393] building modules from 3.8.0rc1 fails in a venv when system 3.8 is present

2019-10-07 Thread pmp-p


New submission from pmp-p :

when trying to build rc1 from a b4 venv to prepare a python host for cross 
compilation on ubuntu xenial flavour x64

i got :


cd /tmp
python3.7 -m venv testenv
cd testenv/
. bin/activate
(testenv) /tmp/testenv $ tar xf /tmp/Python-3.8.0rc1.tar.xz && cd 
Python-3.8.0rc1

CC=clang ./configure --prefix=/tmp/python3.host --with-system-ffi 
--disable-ipv6 --without-ensurepip --with-c-locale-coercion --disable-shared && 
make

./python -E ./setup.py  build
step will fail for the reason i suspect is srcdir is taken from system 
python3.8 if installed ( /usr/local in that case )

$ ./python -E 
Python 3.8.0rc1 (default, Oct  7 2019, 15:16:07) 
[Clang 6.0.0 (tags/RELEASE_600/final)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sysconfig
>>> sysconfig.get_config_var('srcdir')
'/usr/local/lib/python3.8/config-3.8-x86_64-linux-gnu'
>>>

--
messages: 354095
nosy: pmpp, vstinner
priority: normal
severity: normal
status: open
title: building modules from 3.8.0rc1 fails in a venv when system 3.8 is present
type: compile error
versions: Python 3.8

___
Python tracker 

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



[issue38393] building modules from 3.8.0rc1 fails in a venv when system 3.8 is present

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

It's not a Python 3.8 regression. Python 3.7 has the same behavior.


cd $HOME
python3.7 -m venv testenv
cd testenv/
. bin/activate

wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0rc1.tar.xz
tar -xf Python-3.8.0rc1.tar.xz && cd Python-3.8.0rc1
CC=clang ./configure --prefix=/tmp/python3.host --with-system-ffi 
--disable-ipv6 --without-ensurepip --with-c-locale-coercion --disable-shared && 
make

Python 3.8 error:

"""
$ make
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Could not find platform independent libraries 
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = './python'
  isolated = 0
  environment = 0
  user site = 1
  import site = 0
  sys._base_executable = '/home/vstinner/testenv/Python-3.8.0rc1/python'
  sys.base_prefix = '/tmp/python3.host'
  sys.base_exec_prefix = '/tmp/python3.host'
  sys.executable = '/home/vstinner/testenv/Python-3.8.0rc1/python'
  sys.prefix = '/tmp/python3.host'
  sys.exec_prefix = '/tmp/python3.host'
  sys.path = [
'/tmp/python3.host/lib/python38.zip',
'/tmp/python3.host/lib/python3.8',
'/tmp/python3.host/lib/lib-dynload',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the 
filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

Current thread 0x7ff6a75f6740 (most recent call first):

generate-posix-vars failed
make: *** [Makefile:592: pybuilddir.txt] Error 1
"""


cd ..
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
tar -xf Python-3.7.4.tar.xz 
cd Python-3.7.4/
CC=clang ./configure --prefix=/tmp/python3.host --with-system-ffi 
--disable-ipv6 --without-ensurepip --with-c-locale-coercion --disable-shared

Python 3.7 error:

"""
$ make
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
Could not find platform independent libraries 
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Fatal Python error: initfsencoding: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'

Current thread 0x7f5a77f5a740 (most recent call first):
/bin/sh : ligne 5 : 19592 Aborted (core dumped)./python -E -S 
-m sysconfig --generate-posix-vars
generate-posix-vars failed
make: *** [Makefile:606: pybuilddir.txt] Error 1
"""

--
components: +Build

___
Python tracker 

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



[issue38393] building modules from 3.8.0rc1 fails in a venv when system 3.8 is present

2019-10-07 Thread pmp-p


Change by pmp-p :


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



[issue38394] time.get_clock_info reports "adjustable=False" for implementation="CLOCK_MONOTONIC"

2019-10-07 Thread Florian Krause


New submission from Florian Krause :

clock_gettime(CLOCK_MONOTONIC) is adjustable via NTP, as described here: 
https://linux.die.net/man/2/clock_gettime

(and also mentioned in PEP 418).

Yet, time.get_clock_info reports it as "adjustable=False" (this even seems to 
be hardcoded for all clocks on Linux).

--
components: Library (Lib)
messages: 354097
nosy: Florian Krause
priority: normal
severity: normal
status: open
title: time.get_clock_info reports "adjustable=False" for 
implementation="CLOCK_MONOTONIC"
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



[issue38393] building modules from 3.8.0rc1 fails in a venv when system 3.8 is present

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

The problem is that Python looks for pyvenv.cfg in the program directory or in 
its parent directory. For example:

/tmp/testenv/Python-3.8.0rc1/python looks for 
/tmp/testenv/Python-3.8.0rc1/pyvenv.cfg (doesn't exist) and 
/tmp/testenv/Python-3.8.0rc1/pyvenv.cfg (exists). On my system, pyvenv.cfg 
contains:
---
home = /usr/bin
include-system-site-packages = false
version = 3.7.4
---

We should add an option to ignore pyvenv.cfg, or modify an existing option like 
-I to ignore pyvenv.cfg.

--

___
Python tracker 

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



[issue38394] time.get_clock_info reports "adjustable=False" for implementation="CLOCK_MONOTONIC"

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

Well, that's more a documentation issue than a bug.

"adjustable=False" in the context of Python means that the clock cannot jump a 
day forward or one day backwards.

For example, on my Fedora 30, I cannot set CLOCK_MONOTONIC clock as root:

$ sudo python3
>>> import time
>>> time.clock_settime(time.CLOCK_MONOTONIC, 
>>> time.clock_gettime(time.CLOCK_MONOTONIC))
OSError: [Errno 22] Invalid argument

In the Linux kernel, NTP adjusts CLOCK_MONOTONIC so it really measures time in 
*seconds*, rather something faster or slower than one second :-)

Python time.monotonic() documentation clearly states that it uses the unit of 
one second:
https://docs.python.org/dev/library/time.html#time.monotonic
"Return the value (in fractional seconds) of a monotonic clock, i.e. a clock 
that cannot go backwards. (...)"

CLOCK_MONOTONIC_RAW must not be used for time.monotonic() because it doesn't 
use an unit of 1 second.

Feel free to propose a documentation enhancement :-)

https://docs.python.org/dev/library/time.html#time.get_clock_info

--
nosy: +vstinner

___
Python tracker 

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



[issue21970] Broken code for handling file://host in urllib.request.FileHandler.file_open

2019-10-07 Thread Maarten ter Huurne


Maarten ter Huurne  added the comment:

Another problem with the current code is that when passed a URL with a host 
name that is not empty or "localhost", but is one of the alternative names for 
localhost returned by get_names(), file_open() returns None implicitly instead 
of opening the file.

I think this issue would be fixed by the proposed patch. So it would be good if 
the patch could be reviewed and adopted.

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



[issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used

2019-10-07 Thread Maarten ter Huurne


Maarten ter Huurne  added the comment:

Can I please get a review of the pull request?

--

___
Python tracker 

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



[issue38395] proxy_contains (weakref.proxy) can access an object with 0 refcount

2019-10-07 Thread Sam Gross


New submission from Sam Gross :

The implementation of weakref.proxy's methods call back into the Python API 
using a "borrowed reference" of the weakly referenced object (acquired via 
PyWeakref_GET_OBJECT). This API call may delete the last reference to the 
object (either directly or via GC), leaving a dangling pointer, which can be 
subsequently dereferenced.

Tested with Python 3.8.0b4 (debug build)

The following code crashes with a debug build of Python 3.8.0b4 on Linux.

import weakref

obj = None

class MyObj:
def __iter__(self):
global obj
del obj
return NotImplemented

obj = MyObj()
p = weakref.proxy(obj)
print(5 in p)


This particular test case does not crash with a release build (on Linux).

The implementation of `in` on a proxy object calls proxy_contains:

   return PySequence_Contains(PyWeakref_GET_OBJECT(proxy), value);

https://github.com/python/cpython/blob/v3.8.0b4/Objects/weakrefobject.c#L556


This eventually calls _PySequence_IterSearch. The call to PyObject_GetIter can 
call arbitrary code, which can lead to seq (the proxy's referent) being 
deleted. The subsequent call to type_error dereferences a dead object. 

it = PyObject_GetIter(seq);
if (it == NULL) {
type_error("argument of type '%.200s' is not iterable", seq);
return -1;
}

https://github.com/python/cpython/blob/v3.8.0b4/Objects/abstract.c#L2003-L2007

I believe some functions, like proxy_length, may be immune to this problem 
because they do not access the borrowed referent after calling into user code. 
However, this is hard to verify from reading the code and may be fragile -- 
small changes to PyObject_Length/Size, for example, might .

See also https://bugs.python.org/issue16602

--
components: Interpreter Core
messages: 354102
nosy: colesbury
priority: normal
severity: normal
status: open
title: proxy_contains (weakref.proxy) can access an object with 0 refcount
type: crash
versions: Python 3.8

___
Python tracker 

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



[issue34271] Please support logging of SSL master secret by env variable SSLKEYLOGFILE

2019-10-07 Thread Sascha Silbe


Change by Sascha Silbe :


--
nosy: +sascha_silbe

___
Python tracker 

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



[issue38396] ast.literal_eval doesn't give information about node except the type of it

2019-10-07 Thread Batuhan


New submission from Batuhan :

def _convert_num(node):
if isinstance(node, Constant):
if type(node.value) in (int, float, complex):
return node.value
>   raise ValueError('malformed node or string: ' + repr(node))
E   ValueError: malformed node or string: <_ast.Name object at 
0x7f0e7ebab320>

When a malformed node passes into literal_eval, it raises ValueError with repr 
of node (which is just a memory address and type). I think using dump(node) at 
there is a better option, like

node = <_ast.Name object at 0x7fa8279847d0>

def _convert_num(node):
if isinstance(node, Constant):
if type(node.value) in (int, float, complex):
return node.value
>   raise ValueError('malformed node or string: ' + dump(node))
E   ValueError: malformed node or string: Name(id='a', ctx=Load())

--
components: Library (Lib)
messages: 354103
nosy: BTaskaya
priority: normal
severity: normal
status: open
title: ast.literal_eval doesn't give information about node except the type of 
it
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



[issue38396] ast.literal_eval doesn't give information about node except the type of it

2019-10-07 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue38396] ast.literal_eval doesn't give information about node except the type of it

2019-10-07 Thread Batuhan


Change by Batuhan :


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

___
Python tracker 

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



[issue38397] __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)

2019-10-07 Thread retnikt


New submission from retnikt :

Essentially the same as https://bugs.python.org/issue29581 (more detail is 
there), but for the additional meta-classes enum.EnumMeta and probably 
typing.NamedTupleMeta (discussion needed - is there a use-case for this?)

The __new__ method on these metaclasses should include **kwargs at the end of 
the method definition and pass them on to the super call in order to allow the 
special method __init_subclass__ to be defined with custom parameters on 
classes using the metaclass.

(also, perhaps the issue for typing should be reported separately on github 
python/typing instead)

--
components: Library (Lib)
messages: 354104
nosy: retnikt
priority: normal
severity: normal
status: open
title: __init_subclass__ causes TypeError when used with more standard library 
metaclasses (such as EnumMeta)
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



[issue38398] PyUnicode functions are not exported by python 2 in Ubuntu

2019-10-07 Thread PyScripter

New submission from PyScripter :

As per title PyUnicode functions, such as PyUnicode_FromWideChar, are not 
exported on Ubuntu and possibly other Linux systems.  This is a show stopper 
for embedded Python.

To confirm:

>>> import ctypes
>>> hasattr(ctypes.pythonapi, "PyUnicode_FromWideChar")

It should return True, but it returns False.  

I have tested with the default Ubuntu python 2.7.15 and with compiled python 
2.7.16.

Note that the problem does not exist in python3 and also python 2.7 and 3.x in 
Windows.  So it is only python 2.7 in Ubuntu.

--
components: Library (Lib)
messages: 354105
nosy: pyscripter
priority: normal
severity: normal
status: open
title: PyUnicode functions are not exported by python 2 in Ubuntu
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue38398] PyUnicode functions are not exported by python 2 in Ubuntu

2019-10-07 Thread Zachary Ware


Zachary Ware  added the comment:

Given that 2.7 is reaching end-of-life in a single-digit number of months, I 
doubt anything will be changed here.  I'll leave it up to Benjamin to make that 
determination, though.

--
nosy: +benjamin.peterson, zach.ware

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-10-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16209
pull_request: https://github.com/python/cpython/pull/16622

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-10-07 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 321def805abc5b7c92c7e90ca90cb2434fdab855 by Yury Selivanov (Ben 
Harper) in branch 'master':
bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)
https://github.com/python/cpython/commit/321def805abc5b7c92c7e90ca90cb2434fdab855


--
nosy: +yselivanov

___
Python tracker 

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



[issue38398] PyUnicode functions are not exported by python 2 in Ubuntu

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

> hasattr(ctypes.pythonapi, "PyUnicode_FromWideChar")

Python 2 has a surprising ABI. The function names depending on the Unicode 
implementation:

PyUnicodeUCS2_FromWideChar on Windows, PyUnicodeUCS4_FromWideChar on other 
platforms.

Enjoy the ugly 
https://github.com/python/cpython/blob/2.7/Include/unicodeobject.h

And say hello to the new compact Unicode strings, PEP 393, implemented in 
Python 3.3, which unified that!
https://www.python.org/dev/peps/pep-0393/

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



[issue38376] ./configure --with-assertions generates a broken build

2019-10-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16210
pull_request: https://github.com/python/cpython/pull/16623

___
Python tracker 

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



[issue38398] PyUnicode functions are not exported by python 2 in Ubuntu

2019-10-07 Thread PyScripter


PyScripter  added the comment:

To Victor:

Neither of PyUnicodeUCS2_FromWideChar or PyUnicodeUCS4_FromWideChar is exported.

>>> import ctypes
>>> hasattr(ctypes.pythonapi, "PyUnicode_FromWideChar")
>>> hasattr(ctypes.pythonapi, "PyUnicodeUSC4_FromWideChar")
>>> hasattr(ctypes.pythonapi, "PyUnicodeUSC2_FromWideChar")

all return false on Ubuntu.

--

___
Python tracker 

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



[issue38397] __init_subclass__ causes TypeError when used with more standard library metaclasses (such as EnumMeta)

2019-10-07 Thread retnikt


retnikt  added the comment:

I can (and will) submit a PR for this, by the way.

--

___
Python tracker 

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



[issue38398] PyUnicode functions are not exported by python 2 in Ubuntu

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

ctypes.pythonapi is kind of magic. I'm not sure if hasattr() is supposed to 
work on it. But that works for me:

$ python2
Python 2.7.16 (default, Apr 30 2019, 15:54:43) 
>>> import ctypes
>>> ctypes.pythonapi.PyUnicodeUCS4_FromWideChar
<_FuncPtr object at 0x7f1b9c155ef0>

--

___
Python tracker 

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



[issue38398] PyUnicode functions are not exported by python 2 in Ubuntu

2019-10-07 Thread PyScripter


PyScripter  added the comment:

I meant PyUnicodeUCS4_FromWideChar PyUnicodeUCS2_FromWideChar.

--

___
Python tracker 

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



[issue38398] PyUnicode functions are not exported by python 2 in Ubuntu

2019-10-07 Thread PyScripter


PyScripter  added the comment:

Is this on Ubuntu?

--

___
Python tracker 

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



[issue38398] PyUnicode functions are not exported by python 2 in Ubuntu

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

> Is this on Ubuntu?

No, only Fedora. If the issue is specific to Ubuntu, report it to the Ubuntu 
bug tracker.

--

___
Python tracker 

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



[issue38398] PyUnicode functions are not exported by python 2 in Ubuntu

2019-10-07 Thread PyScripter


PyScripter  added the comment:

>>> sys.version
'2.7.16 (default, Oct  7 2019, 17:16:30) \n[GCC 7.4.0]'
>>> ctypes.pythonapi.PyUnicodeUCS4_FromWideChar
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python2.7/ctypes/__init__.py", line 379, in __getattr__
func = self.__getitem__(name)
  File "/usr/local/lib/python2.7/ctypes/__init__.py", line 384, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: python2.7: undefined symbol: PyUnicodeUCS4_FromWideChar
>>>

--

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-10-07 Thread miss-islington


miss-islington  added the comment:


New changeset 13915a3100608f011b29da2f3716c990f523b631 by Miss Islington (bot) 
in branch '3.8':
bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)
https://github.com/python/cpython/commit/13915a3100608f011b29da2f3716c990f523b631


--
nosy: +miss-islington

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6876257eaabdb30f27ebcbd7d2557278ce2e5705 by Victor Stinner in 
branch 'master':
bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)
https://github.com/python/cpython/commit/6876257eaabdb30f27ebcbd7d2557278ce2e5705


--

___
Python tracker 

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



[issue38376] ./configure --with-assertions generates a broken build

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 6876257eaabdb30f27ebcbd7d2557278ce2e5705 by Victor Stinner in 
branch 'master':
bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)
https://github.com/python/cpython/commit/6876257eaabdb30f27ebcbd7d2557278ce2e5705


--

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:

Can we close this issue, or is there a remaining known bug?

--

___
Python tracker 

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



[issue38399] Error message persists when reimporting library

2019-10-07 Thread AwesomeCronk


New submission from AwesomeCronk :

I am working on a hexdump library in Python 3.7.4.
Whenever an issue is triggered, the error message shows up. I can usually edit 
and correct the file(library), but when I reimport the library and rerun the 
function, it throws the same error on the same line number, even if the line 
was removed or commented out.

--
components: Interpreter Core
files: pythonerror.png
messages: 354120
nosy: AwesomeCronk
priority: normal
severity: normal
status: open
title: Error message persists when reimporting library
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48645/pythonerror.png

___
Python tracker 

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



[issue38399] Error message persists when reimporting library

2019-10-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I think this is due to str bytes concatenation error on line number 19. Editing 
and reimporting doesn't give you new code in repl. Try the changes in new repl 
after changing it in file. Python will just use unchanged code and will use 
line number 19 in traceback to show error which is different as file was edited.

--
nosy: +xtreak

___
Python tracker 

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



[issue26219] implement per-opcode cache in ceval

2019-10-07 Thread Brett Cannon


Brett Cannon  added the comment:

I personally think it would be fine to change the wording to say "measurable 
speed-up" and not attribute a specific number.

--

___
Python tracker 

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



[issue36356] Failure to build with address sanitizer

2019-10-07 Thread Ned Deily


Ned Deily  added the comment:

FWIW, the assertion error on macOS reported above in msg338774 does not seem to 
occur anymore with current HEAD of master and with recent system clang (Apple 
clang version 11.0.0 (clang-1100.0.33.8)) on macOS 10.14.6.

--

___
Python tracker 

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



[issue38375] Enum lookup fails for callable values

2019-10-07 Thread Ethan Furman


Ethan Furman  added the comment:

This is the intended, and documented, behavior.

--
assignee:  -> ethan.furman
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



[issue38379] finalizer resurrection in gc

2019-10-07 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue38388] Pickle protocol v 5 needs to be documented

2019-10-07 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue37591] test_concurrent_future failed

2019-10-07 Thread Isaac Turner


Isaac Turner  added the comment:

I'm seeing the same error on Ubuntu LTS 16.04.6 on an ARM64 platform.

$ make && make test

...

0:09:18 load avg: 2.09 [ 78/416] test_complex
0:09:20 load avg: 2.08 [ 79/416] test_concurrent_futures

Traceback:
 Thread 0x007f61f0 (most recent call first):
  File "/home/minit/Python-3.7.4/Lib/threading.py", line 296 in wait
  File "/home/minit/Python-3.7.4/Lib/multiprocessing/queues.py", line 224 in 
_feed
  File "/home/minit/Python-3.7.4/Lib/threading.py", line 870 in run
  File "/home/minit/Python-3.7.4/Lib/threading.py", line 926 in _bootstrap_inner
  File "/home/minit/Python-3.7.4/Lib/threading.py", line 890 in _bootstrap

Thread 0x007f93fff1f0 (most recent call first):
  File "/home/minit/Python-3.7.4/Lib/selectors.py", line 415 in select
  File "/home/minit/Python-3.7.4/Lib/multiprocessing/connection.py", line 920 
in wait
  File "/home/minit/Python-3.7.4/Lib/concurrent/futures/process.py", line 361 
in _queue_management_worker
  File "/home/minit/Python-3.7.4/Lib/threading.py", line 870 in run
  File "/home/minit/Python-3.7.4/Lib/threading.py", line 926 in _bootstrap_inner
  File "/home/minit/Python-3.7.4/Lib/threading.py", line 890 in _bootstrap

Current thread 0x007fa6296000 (most recent call first):
  File "/home/minit/Python-3.7.4/Lib/test/test_concurrent_futures.py", line 917 
in _fail_on_deadlock
  File "/home/minit/Python-3.7.4/Lib/test/test_concurrent_futures.py", line 978 
in test_crash
  File "/home/minit/Python-3.7.4/Lib/unittest/case.py", line 628 in run
  File "/home/minit/Python-3.7.4/Lib/unittest/case.py", line 676 in __call__
  File "/home/minit/Python-3.7.4/Lib/unittest/suite.py", line 122 in run
  File "/home/minit/Python-3.7.4/Lib/unittest/suite.py", line 84 in __call__
  File "/home/minit/Python-3.7.4/Lib/unittest/suite.py", line 122 in run
  File "/home/minit/Python-3.7.4/Lib/unittest/suite.py", line 84 in __call__
  File "/home/minit/Python-3.7.4/Lib/unittest/suite.py", line 122 in run
  File "/home/minit/Python-3.7.4/Lib/unittest/suite.py", line 84 in __call__
  File "/home/minit/Python-3.7.4/Lib/test/support/testresult.py", line 162 in 
run
  File "/home/minit/Python-3.7.4/Lib/test/support/__init__.py", line 1915 in 
_run_suite
  File "/home/minit/Python-3.7.4/Lib/test/support/__init__.py", line 2011 in 
run_unittest
  File "/home/minit/Python-3.7.4/Lib/test/test_concurrent_futures.py", line 
1245 in test_main
  File "/home/minit/Python-3.7.4/Lib/test/support/__init__.py", line 2143 in 
decorator
  File "/home/minit/Python-3.7.4/Lib/test/libregrtest/runtest.py", line 228 in 
_runtest_inner2
  File "/home/minit/Python-3.7.4/Lib/test/libregrtest/runtest.py", line 264 in 
_runtest_inner
  File "/home/minit/Python-3.7.4/Lib/test/libregrtest/runtest.py", line 149 in 
_runtest
  File "/home/minit/Python-3.7.4/Lib/test/libregrtest/runtest.py", line 187 in 
runtest
  File "/home/minit/Python-3.7.4/Lib/test/libregrtest/main.py", line 390 in 
run_tests_sequential
  File "/home/minit/Python-3.7.4/Lib/test/libregrtest/main.py", line 488 in 
run_tests
  File "/home/minit/Python-3.7.4/Lib/test/libregrtest/main.py", line 642 in 
_main
  File "/home/minit/Python-3.7.4/Lib/test/libregrtest/main.py", line 588 in main
  File "/home/minit/Python-3.7.4/Lib/test/libregrtest/main.py", line 663 in main
  File "/home/minit/Python-3.7.4/Lib/test/regrtest.py", line 46 in _main
  File "/home/minit/Python-3.7.4/Lib/test/regrtest.py", line 50 in 
  File "/home/minit/Python-3.7.4/Lib/runpy.py", line 85 in _run_code
  File "/home/minit/Python-3.7.4/Lib/runpy.py", line 193 in _run_module_as_main

test test_concurrent_futures failed

--
nosy: +Isaac Turner

___
Python tracker 

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



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-10-07 Thread Adam Williamson


Adam Williamson  added the comment:

Well, now our (Fedora QA's) automated testing of FreeIPA is showing what looks 
like a problem with preexec_fn (rather than fork) being disallowed:

https://bugzilla.redhat.com/show_bug.cgi?id=1759290

Login to the FreeIPA webUI is failing, and at the time it fails we see this 
error message on the server end:

[Mon Oct 07 09:22:19.521604 2019] [wsgi:error] [pid 32989:tid 139746234119936] 
[remote 10.0.2.102:56054] ipa: DEBUG: args=['/usr/bin/kinit', 'admin', '-c', 
'/run/ipa/ccaches/kinit_32989', '-E']
[Mon Oct 07 09:22:19.521996 2019] [wsgi:error] [pid 32989:tid 139746234119936] 
[remote 10.0.2.102:56054] ipa: DEBUG: Process execution failed
[Mon Oct 07 09:22:19.522189 2019] [wsgi:error] [pid 32989:tid 139746234119936] 
[remote 10.0.2.102:56054] ipa: INFO: 401 Unauthorized: preexec_fn not supported 
within subinterpreters

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

___
Python tracker 

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



[issue38375] Enum lookup fails for callable values

2019-10-07 Thread Massimo


Massimo  added the comment:

Where is this documented? Sorry, I couldn't find it.

In any case, I'd say this behaviour is quite unexpected, and unless technical 
reasons are overwhelming, would be nice to change it.

--

___
Python tracker 

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



[issue36697] inspect.getclosurevars returns wrong globals dict

2019-10-07 Thread Daniel Debrunner


Daniel Debrunner  added the comment:

Another case:

model="Hello"
class M(object):
def __init__(self):
pass
def __call__(self):
print(self.model)

cvs = inspect.getclosurevars(M.__call__)

ClosureVars(nonlocals={}, globals={'model': 'Hello'}, builtins={'print': 
}, unbound=set())

Of course self.model does not refer to the global model
M()()
AttributeError: 'M' object has no attribute 'model'

--
nosy: +Daniel Debrunner

___
Python tracker 

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



[issue38376] ./configure --with-assertions generates a broken build

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 435b2eeb7bc5b8ec264e900b38bcb3d76552d777 by Victor Stinner in 
branch '3.8':
bpo-38376: Fix _PyUnicode_CheckConsistency() definition (GH-16623)
https://github.com/python/cpython/commit/435b2eeb7bc5b8ec264e900b38bcb3d76552d777


--

___
Python tracker 

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



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-10-07 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

preexec_fn is fundamentally unsupportable.

what code is using it, there should be a way not to rely on that.

--

___
Python tracker 

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



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-10-07 Thread Adam Williamson


Adam Williamson  added the comment:

It's this function:

https://github.com/freeipa/freeipa/blob/master/ipalib/install/kinit.py#L66

The function `run` is imported from `ipapython.ipautil`, it's defined here:

https://github.com/freeipa/freeipa/blob/master/ipapython/ipautil.py#L391

all of this is being run inside a WSGI.

--

___
Python tracker 

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



[issue38396] ast.literal_eval doesn't give information about node except the type of it

2019-10-07 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

The downside however is that exception messages can become very long. So I am 
not sure we should change this.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38396] ast.literal_eval doesn't give information about node except the type of it

2019-10-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have same doubts.

See also issue32888.

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Improve exception message in ast.literal_eval

___
Python tracker 

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



[issue32879] Race condition in multiprocessing Queue

2019-10-07 Thread Eric Meyer


Eric Meyer  added the comment:

multiprocessing.SimpleQueue is another workaround to this issue.

I agree the docs should be clearer about this. Additionally, it would be 
helpful if there was a way to optionally put an item on a multiprocessing.Queue 
and block until the item has been written to the pipe (or block until it is 
safe to mutate,garbage collect,etc the item in the calling thread).

--
nosy: +highvelcty

___
Python tracker 

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



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-10-07 Thread Christian Heimes


Christian Heimes  added the comment:

I'll address the issue in FreeIPA.

The ipautil.run() function is a helper around subprocess.Popen. The function 
always installs a preexec_fn in case it needs to change umask or drop 
priviliges. The WSGI server does not need these features.

--

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-10-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16211
pull_request: https://github.com/python/cpython/pull/16624

___
Python tracker 

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



[issue37951] Disallow fork in a subinterpreter broke subprocesses in mod_wsgi daemon mode

2019-10-07 Thread Christian Heimes


Christian Heimes  added the comment:

https://github.com/freeipa/freeipa/pull/3769 should address the issue.

--

___
Python tracker 

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



[issue36953] Remove collections ABCs?

2019-10-07 Thread Emmanuel Arias


Emmanuel Arias  added the comment:

Now was remove from 3.7

https://github.com/python/cpython/commit/ef092fe9905f61ca27889092ca1248a11aa74498

This issue should be closed, isn't?

--

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-10-07 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 60ec6efd96d95476fe5e38c491491add04f026e5 by Victor Stinner in 
branch 'master':
bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)
https://github.com/python/cpython/commit/60ec6efd96d95476fe5e38c491491add04f026e5


--

___
Python tracker 

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



  1   2   >