[issue38436] Improved performance for list addition.

2019-10-16 Thread Brandt Bucher


Brandt Bucher  added the comment:

I'm going to go ahead and close this, since the payoff doesn't seem to be worth 
the effort.

Thanks for the benchmarking and feedback!

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



[issue34864] In Idle, Mac tabs make editor status line disappear.

2019-10-16 Thread Ned Deily


Ned Deily  added the comment:

Should be: "I did't *try* elsewhere.", not "see elsewhere".

--

___
Python tracker 

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



[issue34864] In Idle, Mac tabs make editor status line disappear.

2019-10-16 Thread Ned Deily


Ned Deily  added the comment:

FTR, Raymond reports in a tweet 
(https://twitter.com/raymondh/status/1184667350953447424) that it is possible 
to get logged out if you ignore the warning and try to open a file in IDLE when 
the System Preference is set to always open documents in tabs.  I was able to 
reproduce with macOS 10.14.6 on real hardware (I didn't see elsewhere).  This 
is clearly a Tk issue and there has been a lot of work going on in Tk in this 
area since Tk 8.6.8.  We have been waiting for an official 8.6.10 release to 
again try to update the python.org built-in Tcl/Tk after the very 
unsatisfactory experience with 8.6.9; until then still best to heed the warning!

--

___
Python tracker 

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



[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-16 Thread Louis Huemiller


Louis Huemiller  added the comment:

Thank you for looking into the potential issue. Instead of getting Python3.8 
from ppa:deadsnakes/ppa, I downloaded the source from:

  https://www.python.org/ftp/python/3.8.0/Python-3.8.0rc1.tgz

Then did the following to build and install it:

  $ cd /usr/src
  $ sudo tar xzf ~/Python-3.8.0rc1.tgz
  $ cd Python-3.8.0rc1/
  $ sudo ./configure --enable-optimizations
  $ sudo apt-get install zlib1g-dev
  $ sudo -H make altinstall

Then re-running the magiccube2x2 permutations with a max_depth of 6 I obtained:

  $ python3.7 permutations2x2 --max_depth 6 | egrep "^# Total_Time"
  # Total_Time: 61.90

  $ python3.8 permutations2x2 --max_depth 6 | egrep "^# Total_Time"
  # Total_Time: 82.45

Unfortunately, this still shows the Python3.8 execution as significantly 
slower, in this case 33.2% slower. Not sure of the cause, but perhaps I wasn't 
completely successful at removing the prior installation from 
ppa:deadsnakes/ppa. I removed it through the use of:

  $ sudo apt remove python3.8
  $ sudo add-apt-repository -r ppa:deadsnakes/ppa
  $ shutdown -r now

Next step I will completly re-install this server and then only install 
Python3.8 from https://www.python.org/ftp/python/3.8.0/Python-3.8.0rc1.tgz.

--

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-10-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Please open a new issue. It's getting little hard to track on this since it was 
closed and has 2 PRs merged.

--

___
Python tracker 

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



[issue38493] os.CLD_KILLED should be implemented

2019-10-16 Thread Dong-hee Na


Dong-hee Na  added the comment:

> What about CLD_STOPPED?

I think that it should be added also.
I 've added the CLD_STOPPED on PR 16821.

--

___
Python tracker 

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



[issue17123] Add OCSP support to ssl module

2019-10-16 Thread Daniel Kahn Gillmor


Daniel Kahn Gillmor  added the comment:

On Thu 2019-10-10 01:38:42 +, Benjamin Peterson wrote:

> Considering OSCP has fallen out of favor relative to CT in recent
> years, may be should simply reject this feature request.

CT provides the possibility of a website operator to *detect* CA
malfeasance.

OCSP provides a live "proof of freshness" of the certificate at a
cadence significantly shorter than the lifetime of most certificates
(even the 90-day certificates offered by ACME-driven CAs like Let's
Encrypt).

These are orthogonal, and mutually-reinforcing mechanisms, not competing
mechanisms.

  --dkg

--

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2019-10-16 Thread Paul Silisteanu


Paul Silisteanu  added the comment:

Same issue on Window 10 and macOS Catalina with Python 3.8.0.
Here is the error I get on Windows 10:

C:\Users\x>py -3.8
Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing import get_context
>>>
>>> class A(object):
... def __init__(self):
... self.pool = get_context(None).Pool(2)
...
>>> solver=A()
>>> quit()
Process SpawnPoolWorker-2:
Error in atexit._run_exitfuncs:
Process SpawnPoolWorker-1:
Traceback (most recent call last):
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py",
 line 313, in _bootstrap
self.run()
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py",
 line 108, in run
self._target(*self._args, **self._kwargs)
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\pool.py",
 line 114, in worker
task = get()
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\queues.py",
 line 355, in get
with self._rlock:
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\synchronize.py",
 line 95, in __enter__
return self._semlock.__enter__()
Traceback (most recent call last):
KeyboardInterrupt
Traceback (most recent call last):
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\util.py",
 line 277, in _run_finalizers
finalizer()
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\util.py",
 line 201, in __call__
res = self._callback(*self._args, **self._kwargs)
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\pool.py",
 line 689, in _terminate_pool
cls._help_stuff_finish(inqueue, task_handler, len(pool))
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\pool.py",
 line 674, in _help_stuff_finish
inqueue._rlock.acquire()
KeyboardInterrupt
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py",
 line 313, in _bootstrap
self.run()
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\process.py",
 line 108, in run
self._target(*self._args, **self._kwargs)
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\pool.py",
 line 114, in worker
task = get()
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\queues.py",
 line 356, in get
res = self._reader.recv_bytes()
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\connection.py",
 line 216, in recv_bytes
buf = self._recv_bytes(maxlength)
  File 
"C:\Users\x\AppData\Local\Programs\Python\Python38\lib\multiprocessing\connection.py",
 line 305, in _recv_bytes
waitres = _winapi.WaitForMultipleObjects(
KeyboardInterrupt

C:\Users\x>

--
nosy: +Paul Silisteanu

___
Python tracker 

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



[issue33725] Python crashes on macOS after fork with no exec

2019-10-16 Thread Ryan May


Change by Ryan May :


--
nosy: +Ryan May

___
Python tracker 

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



[issue38207] subprocess: Popen.kill() + Popen.communicate() is blocking until all processes using the pipe close the pipe

2019-10-16 Thread STINNER Victor


STINNER Victor  added the comment:

On Windows, the threads reading pipes continue to run even after the direct 
child process exited.

Problem: at Python exit (main process), Python hangs on calling 
threading._shutdown() which waits until all Python threads complete.

One enhancement would be to spawn subprocess.Popen.communicate() internal 
threads as daemon threads. So threading._shutdown() would not wait for them at 
Python exit.

--

___
Python tracker 

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



[issue24302] Dead Code of Handler check in function faulthandler_fatal_error()

2019-10-16 Thread STINNER Victor


Change by STINNER Victor :


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



[issue38502] regrtest: use process groups

2019-10-16 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-12413 "make faulthandler dump traceback of child processes" which 
looks like a duplicate of bpo-18969.

--

___
Python tracker 

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



[issue38502] regrtest: use process groups

2019-10-16 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-18969: "test suite: enable faulthandler timeout in assert_python". 
This issue proposes to use killpg() to send a signal to all Python processes 
spawned by regrtest: trigger faulthandler to dump the Python traceback of all 
Python threads.

--

___
Python tracker 

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



[issue38207] subprocess: Popen.kill() + Popen.communicate() is blocking until all processes using the pipe close the pipe

2019-10-16 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-31447: "proc communicate not exiting on python subprocess timeout 
using PIPES".

--

___
Python tracker 

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



[issue38207] subprocess: Popen.kill() + Popen.communicate() is blocking until all processes using the pipe close the pipe

2019-10-16 Thread STINNER Victor


Change by STINNER Victor :


--
title: subprocess: On Windows, Popen.kill() + Popen.communicate() is blocking 
until all processes using the pipe close the pipe -> subprocess: Popen.kill() + 
Popen.communicate() is blocking until all processes using the pipe close the 
pipe

___
Python tracker 

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



[issue38502] regrtest: use process groups

2019-10-16 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue38502] regrtest: use process groups

2019-10-16 Thread STINNER Victor


STINNER Victor  added the comment:

Example of the problem: sometimes, interrupting a multiprocessing test hangs. 
regrtest fails to interrupt a TestWorkerProcess thread.

$ ./python -m test test_multiprocessing_fork -j10 -F --timeout=60 --slowest
0:00:00 load avg: 1.09 Run tests in parallel using 10 child processes
^C
Kill 
Kill 
Kill 
Kill 
Kill 
Kill 
Kill 
Kill 
Kill 
Kill 
0:00:03 load avg: 1.88 Waiting for  thread for 1.0 sec
0:00:04 load avg: 1.88 Waiting for  thread for 2.0 sec
0:00:05 load avg: 1.73 Waiting for  thread for 3.0 sec
(...)


With my PR, I cannot reproduce the "Waiting for ..." issue anymore.

--

___
Python tracker 

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



[issue38502] regrtest: use process groups

2019-10-16 Thread STINNER Victor


New submission from STINNER Victor :

Problem.

When regrtest is interrupted by CTRL+c and regrtest multiprocessing code (-jN 
command line option) is used, regrtest randomly fails to stop come 
TestWorkerProcess threads.

The problem is that only the direct child process is kill by SIGKILL. If the 
test spawns a grandchild process, this one will not be killed.

Moreover, the grandchild process inherits the child process stdout and stderr. 
But regrtest mltiprocessing uses pipes for the child process stdout and stderr.

At the end, Popen.communicate() hangs randomly in the main regrtest process (in 
a TestWorkerProcess thread) until the child process *and* the grandchild 
process completes. Except that the main regrtest does not directly kill the 
grandchild process.

=> see bpo-38207


Solution.

I propose to:

(1) use Popen() with start_new_session=True: a worker process calls setsid() to 
create a new process group.
(2) Don't kill worker processes, but kill the process groups of worker 
processes.

Attached PR implements this solution.

--
components: Tests
messages: 354818
nosy: vstinner
priority: normal
severity: normal
status: open
title: regrtest: use process groups
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



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

2019-10-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset a661392f8fb5ac4fc095aa1845d1eb7a25c4e9be by Victor Stinner in 
branch 'master':
bpo-37531: regrtest now catchs ProcessLookupError (GH-16827)
https://github.com/python/cpython/commit/a661392f8fb5ac4fc095aa1845d1eb7a25c4e9be


--

___
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-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16377
pull_request: https://github.com/python/cpython/pull/16827

___
Python tracker 

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



[issue17393] stdlib import mistaken for local by import_fixer

2019-10-16 Thread Romuald Brunet


Change by Romuald Brunet :


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

___
Python tracker 

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



[issue35297] untokenize documentation is not correct

2019-10-16 Thread Zachary McCord


Zachary McCord  added the comment:

I think anyone using the tokenize module to programmatically edit python source 
wants to use and probably does use the undocumented behavior, which should then 
be documented.

I ran into this issue because for me this manifested as a crash:

$ python3
>>> import tokenize
>>> tokenize.untokenize([(tokenize.STRING, "''", (1, 0), (1, 0), None)])
"''"
>>> tokenize.untokenize([(tokenize.STRING, "''", None, None, None)])
Traceback (most recent call last):
  File "", line 1, in 
  File "//virtualenv/lib/python3.6/tokenize.py", line 338, in untokenize
out = ut.untokenize(iterable)
  File "//virtualenv/lib/python3.6/tokenize.py", line 272, in untokenize
self.add_whitespace(start)
  File "//virtualenv/lib/python3.6/tokenize.py", line 231, in 
add_whitespace
row, col = start
TypeError: 'NoneType' object is not iterable

The second call is giving untokenize() input that is documented to be valid, 
yet which causes a crash.

--
nosy: +Zachary McCord

___
Python tracker 

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



[issue21478] mock calls don't propagate to parent (autospec)

2019-10-16 Thread Caris Moses


Caris Moses  added the comment:

I believe I have found another bug related to this issue. I can start a new 
issue if necessary. When I use some_mock.attach_mock(...) and make calls, the 
resulting some_mock.call_args is None while the some_mock.mock_calls list is 
not empty.

The code below shows this in Python 3.7.5:

from unittest import TestCase
from unittest.mock import patch, Mock

def foo(value):
return value

class MyObjectTest(TestCase):

@patch(f'{__name__}.foo')
def test_do_something(self, mock_foo):
manager = Mock()
manager.attach_mock(mock_foo, 'foo_func')
foo(3)
print(manager.mock_calls)
print(manager.call_args)

if __name__ == "__main__":
unittest.main()

The print statements return:
[call.foo_func(3)]
None

While the code below (without attach_mock) works fine:
from unittest import TestCase
from unittest.mock import patch, Mock

def foo(value):
return value

class MyObjectTest(TestCase):

@patch(f'{__name__}.foo')
def test_do_something(self, mock_foo):
foo(3)
print(mock_foo.mock_calls)
print(mock_foo.call_args)

if __name__ == "__main__":
unittest.main()

Print statements correctly return:
[call(3)]
call(3)

for completeness the call_args_list also returns [] when using attach_mock. I 
also tested in Python 3.8.0 and got the same result.

--

___
Python tracker 

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



[issue38494] Add assert_not_called_with

2019-10-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Do you know why there is assertRaises(), but there is no assertNotRaises()?

Because assertNotRaises(Exception, callable, *args, **kwargs) would be 
equivalent to just callable(*args, **kwargs). Call the function, and if is 
raised an exception, the test will fail.

Similarly, there is no need of assert_not_called_with(). Just define a function 
which raises an exception when it is called with the specified arguments.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38501] multiprocessing.Pool hangs atexit (and garbage collection sometimes)

2019-10-16 Thread Eric Larson


New submission from Eric Larson :

The following code hangs on Python 3.8.0.rc0 on Ubuntu 19.10 when exiting the 
interpreter:


from multiprocessing import Pool

class A(object):
def __init__(self):
self.pool = Pool(processes=2)

solver = A()


When you eventually do ctrl-C, the traceback is:


^CProcess ForkPoolWorker-2:
Error in atexit._run_exitfuncs:
Process ForkPoolWorker-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/util.py", line 277, in 
_run_finalizers
finalizer()
  File "/usr/lib/python3.8/multiprocessing/util.py", line 201, in __call__
res = self._callback(*self._args, **self._kwargs)
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 689, in 
_terminate_pool
cls._help_stuff_finish(inqueue, task_handler, len(pool))
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 674, in 
_help_stuff_finish
inqueue._rlock.acquire()
KeyboardInterrupt
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 313, in _bootstrap
self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 114, in worker
task = get()
  File "/usr/lib/python3.8/multiprocessing/queues.py", line 355, in get
with self._rlock:
  File "/usr/lib/python3.8/multiprocessing/synchronize.py", line 95, in 
__enter__
return self._semlock.__enter__()
KeyboardInterrupt
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/process.py", line 313, in _bootstrap
self.run()
  File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 114, in worker
task = get()
  File "/usr/lib/python3.8/multiprocessing/queues.py", line 356, in get
res = self._reader.recv_bytes()
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 216, in 
recv_bytes
buf = self._recv_bytes(maxlength)
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 414, in 
_recv_bytes
buf = self._recv(4)
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 379, in _recv
chunk = read(handle, remaining)
KeyboardInterrupt


A similar problem seems to occur when garbage collecting when it's part of a 
class, and that class has not yet called `self.pool.terminate()` and 
`self.pool.close()`. Hopefully fixing the `atexit` behavior will similarly fix 
the `gc.collect()` behavior.

Cross-ref is in SciPy, https://github.com/scipy/scipy/issues/10927. It appears 
to also cause hangs on Travis 3.8-dev builds: 
https://travis-ci.org/scipy/scipy/jobs/598786785

--
components: Library (Lib)
messages: 354813
nosy: Eric Larson
priority: normal
severity: normal
status: open
title: multiprocessing.Pool hangs atexit (and garbage collection sometimes)
type: behavior
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



[issue38497] Wrong argument name in documentation for pipes.Template.open

2019-10-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Semantically mode makes sense to me though rw is correct and Template.open 
docstring has rw. There are docs like unittest where the keyword arguments are 
slightly different from the actual keyword arguments in the assert helpers. I 
guess it's slightly unfortunate that Template.open got rw as keyword argument 
while open uses mode as keyword argument.

--
nosy: +xtreak

___
Python tracker 

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



[issue38494] Add assert_not_called_with

2019-10-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

assert_called_with only checks against the last call. The docs were have been 
fixed with issue35946. So after multiple calls the you might get an assertion 
error in your proposed implementation leading to the conclusion that the call 
never happened but it's just that the last call doesn't match as explained 
below. mock calls are recorded in mock_calls attribute so you can do a contains 
check by constructing the call object to see if the calls are present. For 
multiple calls you can do a list comprehension and use all().

If it's added it would also mean the addition of assert_not_awaited_with for 
AsyncMock. Given that there is contains check to do it one line I am not sure 
it's worthy enough to expand the API. I couldn't find any related proposals in 
the past. assert_not_called is also a shortcut as added in issue21262. I would 
wait for others opinion on this.

./python
Python 3.9.0a0 (heads/master:392a13bb93, Oct 16 2019, 22:59:54) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from unittest.mock import Mock, call
>>> m = Mock()
>>> m(1)

>>> m(2)

>>> m.assert_called_with(1) # Raises AssertionError but the call was actually 
>>> made.
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/xtreak/stuff/python/cpython/Lib/unittest/mock.py", line 902, in 
assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: expected call not found.
Expected: mock(1)
Actual: mock(2)
>>> call(3) not in m.mock_calls # Use contains check instead of iterating 
>>> through call_args_list
True
>>> call(1) not in m.mock_calls
False

--

___
Python tracker 

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



[issue38466] [Easy doc] threading.excepthook doc talks about "object"

2019-10-16 Thread Daniel Baskal


Daniel Baskal  added the comment:

Hi, as a newcomer I'd like to work on this!

Though, I am uncertain about whether these two hooks (threading.excepthook and 
sys.unraisablehook) have similar behavior and wouldn't it be misleading to 
simply change mentions of "object" to "thread" in the docs?

Thanks for the guidance!

--
nosy: +Daniel Baskal

___
Python tracker 

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



[issue38194] Consistently add exist_ok / missing_ok parameters to directory creation/deletion functions

2019-10-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

os.mkdir() and os.rmdir() are wrappers around corresponding system calls. I do 
not think they should have additional parameters, especially for functionality 
which can be easily achieved by wrapping the call with the try/except block.

For shutil.rmtree() see issue29699.

I do not know a good use case for os.removedirs(). Seems it was added for 
symmetry to os.makedirs(), but it looks dangerous, because it can remove more 
than was created by os.makedirs(). shutil.rmtree() looks safer and more useful.

Path.rmdir() I left to the maintainers of the pathlib module.

--

___
Python tracker 

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



[issue38492] Microsoft Store app IDLE (Python 3.8) needs msvcp140.dll

2019-10-16 Thread Steve Dower


Change by Steve Dower :


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



[issue38492] Microsoft Store app IDLE (Python 3.8) needs msvcp140.dll

2019-10-16 Thread miss-islington


miss-islington  added the comment:


New changeset 7773d391f8261a97af502ecfa74a2a588ee05f36 by Miss Islington (bot) 
in branch '3.8':
bpo-38492: Remove pythonw.exe dependency on the Microsoft C++ runtime (GH-16824)
https://github.com/python/cpython/commit/7773d391f8261a97af502ecfa74a2a588ee05f36


--
nosy: +miss-islington

___
Python tracker 

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



[issue38194] Consistently add exist_ok / missing_ok parameters to directory creation/deletion functions

2019-10-16 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38492] Microsoft Store app IDLE (Python 3.8) needs msvcp140.dll

2019-10-16 Thread Steve Dower


Steve Dower  added the comment:


New changeset 7aebbd1182bc818324656b2fb764679faf51fdff by Steve Dower in branch 
'master':
bpo-38492: Remove pythonw.exe dependency on the Microsoft C++ runtime (GH-16824)
https://github.com/python/cpython/commit/7aebbd1182bc818324656b2fb764679faf51fdff


--

___
Python tracker 

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



[issue38492] Microsoft Store app IDLE (Python 3.8) needs msvcp140.dll

2019-10-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16375
pull_request: https://github.com/python/cpython/pull/16825

___
Python tracker 

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



[issue38499] Add rmtree() to pathlib.Path

2019-10-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Concur with Karthikeyan.

pathlib.Path provides an object oriented interface to file path operations and 
to low-level filesystem operations. rmtree() is a high-level and complex 
operation. Instead of adding more and more complex operations to the Path class 
we added support of Path (and more generally, path-like objects) in many other 
functions.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> pathlib.Path wants an rmtree method

___
Python tracker 

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



[issue38499] Add rmtree() to pathlib.Path

2019-10-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

There is shutil.rmtree that accepts path objects and is more high level. From 
the previous discussions with respect to expanding API it's recommended to 
change the functions already present to accept path objects which shutil.rmtree 
already does and not to expand pathlib API.

Some related discussions : 

* https://mail.python.org/pipermail/python-ideas/2015-June/034236.html
* https://mail.python.org/pipermail/python-dev/2016-April/143866.html

--
nosy: +pitrou, serhiy.storchaka, xtreak

___
Python tracker 

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



[issue38492] Microsoft Store app IDLE (Python 3.8) needs msvcp140.dll

2019-10-16 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue38492] Microsoft Store app IDLE (Python 3.8) needs msvcp140.dll

2019-10-16 Thread Steve Dower


Steve Dower  added the comment:

I know what this is - the fix that went into the console executable didn't make 
it into the windowed executable.

--
assignee:  -> steve.dower
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



[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals

2019-10-16 Thread Fabio Zadrozny


New submission from Fabio Zadrozny :

In CPython 3.7 it was possible to do:

#include "pystate.h"
...
PyThreadState *ts = PyThreadState_Get();
PyInterpreterState *interp = ts->interp;
interp->eval_frame = my_frame_eval_func;

This is no longer possible because in 3.8 the PyInterpreterState is opaque, so, 
Py_BUILD_CORE_MODULE needs to be defined defined and 
"internal/pycore_pystate.h" must be included to set 
PyInterpreterState.eval_frame.

This works but isn't ideal -- maybe there could be a function to set 
PyInterpreterState.eval_frame?

--
components: Interpreter Core
messages: 354803
nosy: fabioz, vstinner
priority: normal
severity: normal
status: open
title: Provide a way to get/set PyInterpreterState.frame_eval without needing 
to access interpreter internals
type: enhancement
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



[issue38491] Can not build Python 3.8.0 on Linux - missing dependencies

2019-10-16 Thread Ned Deily


Ned Deily  added the comment:

The Python bug tracker is a place to report bugs, not provide user support.  
There are many other places to get that kind of help and it appears you have 
been receiving help elsewhere.  Good luck!

--
nosy: +ned.deily
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



[issue17393] stdlib import mistaken for local by import_fixer

2019-10-16 Thread Romuald Brunet


Romuald Brunet  added the comment:

Confirming that this issue is still present on 3.8 (and working on a fix)

--

___
Python tracker 

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



[issue17393] stdlib import mistaken for local by import_fixer

2019-10-16 Thread Romuald Brunet


Change by Romuald Brunet :


--
nosy: +Romuald

___
Python tracker 

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



[issue38194] Consistently add exist_ok / missing_ok parameters to directory creation/deletion functions

2019-10-16 Thread Alori


Alori  added the comment:

+1
Encountered the same issue today working with Path.rmdir().
Also see a somewhat related issue here: (https://bugs.python.org/issue38499)

--
nosy: +valorien

___
Python tracker 

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



[issue38499] Add rmtree() to pathlib.Path

2019-10-16 Thread Alori


New submission from Alori :

pathlib.Path supports deletion of both files (Path.unlink()) and directories 
(Path.rmdir()).

Unfortunately, Path.rmdir() does not allow deletion of non-empty directories 
which means users must use shutil.rmtree() when deleting such paths.

Since pathlib.Path already supports file and (empty) directory deletion, adding 
Path.rmtree(missing_ok=False) would support both the utility and the 
completeness of pathlib.

--
components: Library (Lib)
messages: 354799
nosy: valorien
priority: normal
severity: normal
status: open
title: Add rmtree() to pathlib.Path
type: enhancement
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



[issue38493] os.CLD_KILLED should be implemented

2019-10-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What about CLD_STOPPED?

For reference, other CLD_* constants were added in issue10812.

--
nosy: +rosslagerwall, serhiy.storchaka
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



[issue38498] The expression '' in '' == '' is evaluated as True

2019-10-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

For future reference:

Specifically, note that:
'' in '' == ''
is equivalent to:
('' in '') and ('' == '')

--
nosy: +eric.smith
resolution: works for me -> not a bug

___
Python tracker 

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



[issue38496] Python3 allows mixture of tabs and spaces for indentation

2019-10-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, Serhiy. This has been reported in 24260, so I'm closing this issue.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> TabError behavior doesn't match documentation
type:  -> behavior

___
Python tracker 

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



[issue38496] Python3 allows mixture of tabs and spaces for indentation

2019-10-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Seems related issue24260

--
nosy: +xtreak

___
Python tracker 

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



[issue38493] os.CLD_KILLED should be implemented

2019-10-16 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



[issue38493] os.CLD_KILLED should be implemented

2019-10-16 Thread Dong-hee Na


Change by Dong-hee Na :


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

___
Python tracker 

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



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-10-16 Thread STINNER Victor


STINNER Victor  added the comment:

Buildbots are green on the 3.x branch. I backported my fix to 3.7 and 3.8.

I close the issue. I hope that I will not have to reopen it again.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-10-16 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 1bceb0e58905fd6d241d7d566e19ca78558973dd by Victor Stinner in 
branch '3.7':
bpo-35998: Fix test_asyncio.test_start_tls_server_1() (GH-16815) (GH-16818)
https://github.com/python/cpython/commit/1bceb0e58905fd6d241d7d566e19ca78558973dd


--

___
Python tracker 

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



[issue38495] print built-in function docs bug

2019-10-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Maybe just explain defaults in the text?

   Print *objects* to the text stream *file* (the standard output by default), 
separated by *sep* (a space by default) and followed
   by *end* (a newline by default).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38496] Python3 allows mixture of tabs and spaces for indentation

2019-10-16 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your report Mikko. Yes, the heuristic used in Python 3 is unable 
to catch all inconsistencies in using tabs and spaces.

Such bug was already reported early. There should be an open issue.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38490] statistics: add covariance and Pearson's correlation

2019-10-16 Thread Tymek Wołodźko

Tymek Wołodźko  added the comment:

In case there is agreement with Steven, I will add simple linear regression
( https://en.wikipedia.org/wiki/Simple_linear_regression ) in the same PR,
since it is just:

slope = correlation(x, y) * ( stdev(y) / stdev(x) )
intercept = mean(y) - slope * mean(x)

As about covariance, I see your points, but why not keeping it "because we
can"? It can be useful for some users and the functionality still needs to
be implemented to have correlation coefficient.

On Wed, Oct 16, 2019 at 10:47 AM Steven D'Aprano 
wrote:

>
> Steven D'Aprano  added the comment:
>
> I can't speak for other countries, but in Australia, secondary school
> mathematics teaches correlation coefficient and linear regression from
> Year 11 onwards (typically ages 16 or 17). Covariance is not itself
> taught, and as far as I can tell neither the TI-83 nor NSpire
> provides a built-in covariance command.
>
> On the other hand, other calculators such as the HP-48GX do.
>
> Oddly, Excel provides the population (not sample) covariance:
>
>
> https://support.office.com/en-us/article/COVARIANCE-P-function-6F0E1E6D-956D-4E4B-9943-CFEF0BF9EDFC
>
> OpenOffice and LibreOffice also provide a covariance function.
>
> I think that supporting correlation coefficient `r` and linear
> regression would be clear wins, from the perspective of secondary school
> maths. But as far as covariance goes, it would help convince me if you
> had either:
>
> - evidence that covariance is taught in secondary schools, or at
>   least first year undergraduate statistics;
>
> - that it has use-cases beyond "helper for calculating r";
>
> - or that there is demand for it from people who want covariance
>   but can't, or don't want to, use numpy/scipy.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue36076] ssl.get_server_certificate should use SNI

2019-10-16 Thread Juho Vähä-Herttua

Change by Juho Vähä-Herttua :


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

___
Python tracker 

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



[issue38470] test_compileall fails in AMD64 Windows7 SP1 3.x

2019-10-16 Thread Juho Vähä-Herttua

Change by Juho Vähä-Herttua :


--
pull_requests: +16371
pull_request: https://github.com/python/cpython/pull/16819

___
Python tracker 

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



[issue38495] print built-in function docs bug

2019-10-16 Thread Inada Naoki


Inada Naoki  added the comment:

https://github.com/sphinx-doc/sphinx/pull/6401/files

Recent Sphinx uses .
So we can add style like this:

  .sig-paren {
font-family: monospace, sans-serif;
font-style: normal;
  }

--

___
Python tracker 

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



[issue38496] Python3 allows mixture of tabs and spaces for indentation

2019-10-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I believe that the interpreter only requires that each block is consistent, not 
that all blocks in a module are consistent.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue38498] The expression '' in '' == '' is evaluated as True

2019-10-16 Thread Weiliang Li


Weiliang Li  added the comment:

https://docs.python.org/3/reference/expressions.html#comparisons

--

___
Python tracker 

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



[issue38498] The expression '' in '' == '' is evaluated as True

2019-10-16 Thread Weiliang Li


Change by Weiliang Li :


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



[issue38498] The expression '' in '' == '' is evaluated as True

2019-10-16 Thread Weiliang Li


Change by Weiliang Li :


--
resolution:  -> works for me

___
Python tracker 

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



[issue38490] statistics: add covariance and Pearson's correlation

2019-10-16 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I can't speak for other countries, but in Australia, secondary school 
mathematics teaches correlation coefficient and linear regression from 
Year 11 onwards (typically ages 16 or 17). Covariance is not itself 
taught, and as far as I can tell neither the TI-83 nor NSpire 
provides a built-in covariance command.

On the other hand, other calculators such as the HP-48GX do.

Oddly, Excel provides the population (not sample) covariance:

https://support.office.com/en-us/article/COVARIANCE-P-function-6F0E1E6D-956D-4E4B-9943-CFEF0BF9EDFC

OpenOffice and LibreOffice also provide a covariance function.

I think that supporting correlation coefficient `r` and linear 
regression would be clear wins, from the perspective of secondary school 
maths. But as far as covariance goes, it would help convince me if you 
had either:

- evidence that covariance is taught in secondary schools, or at 
  least first year undergraduate statistics;

- that it has use-cases beyond "helper for calculating r";

- or that there is demand for it from people who want covariance 
  but can't, or don't want to, use numpy/scipy.

--

___
Python tracker 

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



[issue38498] The expression '' in '' == '' is evaluated as True

2019-10-16 Thread Weiliang Li


New submission from Weiliang Li :

In [1]: '' in '' == ''  
  
Out[1]: True

In [2]: 'a' in 'a' == 'a'   
  
Out[2]: True

--

___
Python tracker 

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



[issue38498] The expression '' in '' == '' is evaluated as True

2019-10-16 Thread Weiliang Li


Change by Weiliang Li :


--
nosy: kigawas
priority: normal
severity: normal
status: open
title: The expression '' in '' == '' is evaluated as True
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



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-10-16 Thread miss-islington


miss-islington  added the comment:


New changeset afbcd9f26d1bf5390f56f18c9afbf753e48f230d by Miss Islington (bot) 
in branch '3.8':
bpo-35998: Fix test_asyncio.test_start_tls_server_1() (GH-16815)
https://github.com/python/cpython/commit/afbcd9f26d1bf5390f56f18c9afbf753e48f230d


--

___
Python tracker 

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



[issue38495] print built-in function docs bug

2019-10-16 Thread Inada Naoki

Inada Naoki  added the comment:

Space is not trimmed. You can confirm there is a space by copy it from 
rendered HTML.

  print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)¶

So this is caused by rendering sep=' '.
I don't like , but I'm not sure this can be customized by theme.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-10-16 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +16370
pull_request: https://github.com/python/cpython/pull/16818

___
Python tracker 

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



[issue35998] test_asyncio: test_start_tls_server_1() TimeoutError on Fedora 29

2019-10-16 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16369
pull_request: https://github.com/python/cpython/pull/16817

___
Python tracker 

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



[issue38495] print built-in function docs bug

2019-10-16 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

In the sphinx source it's ' ' so maybe it's a problem with the rendering part.

https://raw.githubusercontent.com/python/cpython/master/Doc/library/functions.rst

.. function:: print(*objects, sep=' ', end='\\n', file=sys.stdout, flush=False)

--
nosy: +xtreak

___
Python tracker 

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



[issue38497] Wrong argument name in documentation for pipes.Template.open

2019-10-16 Thread Ilaï

New submission from Ilaï :

Documentation for the pipes module indicates that the second argument of open()
is "mode", but it is actually "rw".

Python 3.7.4 (default, Oct  4 2019, 06:57:26)
[GCC 9.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pipes import Template; Template().open('/tmp/f', mode='r')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: open() got an unexpected keyword argument 'mode'

Python 2.7.16 (default, Mar 11 2019, 18:59:25)
[GCC 8.2.1 20181127] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pipes import Template; Template().open('/tmp/f', mode='r')
Traceback (most recent call last):
  File "", line 1, in 
TypeError: open() got an unexpected keyword argument 'mode'

https://docs.python.org/3/library/pipes.html#pipes.Template.open

--
assignee: docs@python
components: Documentation
messages: 354781
nosy: docs@python, ilai
priority: normal
severity: normal
status: open
title: Wrong argument name in documentation for pipes.Template.open
versions: Python 2.7, 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



[issue38496] Python3 allows mixture of tabs and spaces for indentation

2019-10-16 Thread Eric V. Smith


Eric V. Smith  added the comment:

I can verify this on 3.7.4.

--
nosy: +eric.smith

___
Python tracker 

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



[issue38496] Python3 allows mixture of tabs and spaces for indentation

2019-10-16 Thread Mikko Rantalainen

New submission from Mikko Rantalainen :

Contrary to PEP-8 (https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces) 
claiming "Python 3 disallows mixing the use of tabs and spaces for 
indentation", in reality Python 3 allows mixing tabs and spaces without 
warnings or errors. For example (with all spaces replaced with middle dot and 
all spaces replaced with a short arrow):

#!/usr/bin/python3
for·i·in·range(2):
··for·j·in·range(3):
➧··for·k·in·range(4):
·➧···print(i,j,k,sep=",")

Either the PEP-8 should be fixed or the parser/compiler should be fixed. 

The current behavior seems a bit unstable because the exact order of spaces and 
tabs causes "TabError: inconsistent use of tabs and spaces in indentation" to 
appear more or less random.

I'd prefer python3 to require that *all whitespace* at the start of the all the 
lines is tabs for the whole file or spaces for the whole file. And first 
indented line sets the preference for the whole file.

(Personally I'd prefer tabs contrary to PEP-8 language but this bug is not 
about the preference. This is PEP-8 claiming things that are not true.)

$ python3 --version
Python 3.5.2

--
components: Interpreter Core
messages: 354779
nosy: Mikko Rantalainen
priority: normal
severity: normal
status: open
title: Python3 allows mixture of tabs and spaces for indentation
versions: Python 3.5

___
Python tracker 

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



[issue38373] List overallocation strategy

2019-10-16 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue38495] print built-in function docs bug

2019-10-16 Thread Alex Mashianov


New submission from Alex Mashianov :

Python docs says print() function default sep='': 
http://joxi.ru/EA44JnfonNwLAb.png

While in reality sep=' ':
http://joxi.ru/n2YXyRsbw6oYm6.png

Probably it's a bug with space not being escaped in html to prevent trimming.

--
assignee: docs@python
components: Documentation
messages: 354778
nosy: Alex Mashianov, docs@python
priority: normal
severity: normal
status: open
title: print built-in function docs bug
type: enhancement
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



[issue38474] digit check logic can be replaced by Py_ISDIGIT on prepare_s

2019-10-16 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-16 Thread Gregory P. Smith


Change by Gregory P. 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



[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-16 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

If I compile my own 3.7.5 and 3.8.0 both with --enable-optimizations, I am 
unable to reproduce this.

greg@zoonaut:~/sandbox/python/cpython/lh$ ../b37/python permutations2x2 
--max_depth 6 | egrep "^# Total_Time"
# Total_Time: 75.92
greg@zoonaut:~/sandbox/python/cpython/lh$ ../b38/python permutations2x2 
--max_depth 6 | egrep "^# Total_Time"
# Total_Time: 84.53
greg@zoonaut:~/sandbox/python/cpython/lh$ ../b37/python permutations2x2 
--max_depth 6 | egrep "^# Total_Time"
# Total_Time: 79.90
greg@zoonaut:~/sandbox/python/cpython/lh$ ../b38/python permutations2x2 
--max_depth 6 | egrep "^# Total_Time"
# Total_Time: 84.19
greg@zoonaut:~/sandbox/python/cpython/lh$ ../b37/python permutations2x2 
--max_depth 6 | egrep "^# Total_Time"
# Total_Time: 86.49
greg@zoonaut:~/sandbox/python/cpython/lh$ ../b37/python permutations2x2 
--max_depth 6 | egrep "^# Total_Time"
# Total_Time: 83.95
greg@zoonaut:~/sandbox/python/cpython/lh$ ../b38/python permutations2x2 
--max_depth 6 | egrep "^# Total_Time"
# Total_Time: 78.85
greg@zoonaut:~/sandbox/python/cpython/lh$ ../b38/python permutations2x2 
--max_depth 6 | egrep "^# Total_Time"
# Total_Time: 78.49

which if you add up the 3.7 and 3.8 times over their four runs each, they both 
come out to ~81 seconds average.  So I don't see a regression.

I'd say that benchmark is unstable.  Also, making sure you're comparing 
identically prepared builds of cpython rather than something made by different 
distro package owners.

--
nosy: +gregory.p.smith -inada.naoki
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



[issue38474] digit check logic can be replaced by Py_ISDIGIT on prepare_s

2019-10-16 Thread Dong-hee Na


Dong-hee Na  added the comment:

> I'm inclined to agree: the current code works and is efficient; there's no 
> strong reason to change it.

Okay, then I will close the PR.
I respect core developer's opinions.

--

___
Python tracker 

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



[issue38490] statistics: add covariance and Pearson's correlation

2019-10-16 Thread Tymek Wołodźko

Tymek Wołodźko  added the comment:

I think I see your point, that the module is intended for the most basic
features, but I would argue that correlation is one of such "most basic"
statistics.

Correlation and covariance can be thought as equivalents for standard
deviation and variance, but when we are talking about pairs of variables.
Moreover it is probably used much more often then things like geometric or
harmonic mean, that are implemented in the package. Covariance is probably
more esoteric for most non-statisticians, but in my PR (
https://github.com/python/cpython/pull/16813 ) I implemented it for
completeness and as a helper function for the correlation coefficient.

TL;DR those are basic statistics. They would make the module much more
helpful, since the basic statistics could be calculated using base python
w/o external libraries. They are also trivial to implemented (done this in
PR) and do not need much more maintenance then the other functionalities in
the module.

Tim

śr., 16 paź 2019 o 02:50 Raymond Hettinger 
napisał(a):

>
> Raymond Hettinger  added the comment:
>
> These two functions are right on the boundary edge of what the statistics
> module is trying to do, """The module is not intended to be a competitor to
> third-party libraries such as NumPy, SciPy, or proprietary full-featured
> statistics packages aimed at professional statisticians such as Minitab,
> SAS and Matlab. It is aimed at the level of graphing and scientific
> calculators."""
>
> It is debatable which side of the boundary they belong to. MS Excel has
> both of these functions, but it isn't a given that a scientific calculator
> would have them.
>
> Also, the current functions require only high-school level knowledge, but
> these two require more skill to learn, use, and interpret.
>
> --
> assignee:  -> steven.daprano
> nosy: +rhettinger, steven.daprano
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue38494] Add assert_not_called_with

2019-10-16 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +cjw296, lisroach, mariocj89, michael.foord, xtreak
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



[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-16 Thread Inada Naoki


Inada Naoki  added the comment:

Deadsneak Python 3.8:

>>> sysconfig.get_config_var('CFLAGS')
'-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g   
-fstack-protector-strong -Wformat -Werror=format-security'

Disco /usr/bin/python3.7:

>>> sysconfig.get_config_var('CFLAGS')
'-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g   
-fstack-protector-strong -Wformat -Werror=format-security  -g -flto 
-fuse-linker-plugin -ffat-lto-objects'

So the performance difference comes from optimization options.

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



[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-16 Thread Inada Naoki


Inada Naoki  added the comment:

Ah, my bad.  I meant `perf stat python ...`.

--

___
Python tracker 

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



[issue38477] magiccube2x2 permutations 28% slower with Python 3.8.0rc1 vs 3.7

2019-10-16 Thread Inada Naoki


Inada Naoki  added the comment:

I can not confirm performance regression in 3.8.0.

$ time ~/pyenv/versions/3.7.3/bin/python permutations2x2 --max_depth 6 | egrep 
"^# Total_Time" ; time ~/pyenv/versions/3.8.0/bin/python permutations2x2 
--max_depth 6 | egrep "^# Total_Time"
# Total_Time: 50.24

real0m50.665s   


  user0m49.729s
sys 0m4.354s
# Total_Time: 47.97

real0m48.502s
user0m47.380s
sys 0m4.506s

I suspect that this is a binary specific issue.

Would you try "perf record python ..."?

--

___
Python tracker 

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



[issue38474] digit check logic can be replaced by Py_ISDIGIT on prepare_s

2019-10-16 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Rewriting all this code just because we have Py_ISDIGIT() is a code churn.

I'm inclined to agree: the current code works and is efficient; there's no 
strong reason to change it.

--

___
Python tracker 

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



[issue38494] Add assert_not_called_with

2019-10-16 Thread valkheim


New submission from valkheim :

This would be nice to integrate an assert_not_called_with feature.

I had to implement it to test a publish/subscribe patterns where multiple 
subscibers got called but not with the same arguments.

Here is my implementation:

```
def assert_not_called_with(self, *args, **kwargs):
"""assert that the mock was never called with the specified arguments.
"""
try:
self.assert_called_with(*args, **kwargs)
except AssertionError:
return
raise AssertionError(
"Expected %s to not have been called."
% self._format_mock_call_signature(args, kwargs)
)
```

An alternative would had been to iterate the call_args_list but it wouldn't 
result in a clean one-line assert

coming from: https://github.com/testing-cabal/mock/issues/473

--
messages: 354770
nosy: valkheim
priority: normal
severity: normal
status: open
title: Add assert_not_called_with
type: enhancement

___
Python tracker 

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