[issue34313] Tkinter crashes with Tk-related error on macOS with ActiveTcl 8.6

2018-12-14 Thread Vlad Tudorache


Vlad Tudorache  added the comment:

The only versions of Tk not showing issues on my Mac are:

- 8.5.18 with any Python in 3.5, 3.6, 3.7 on Mojave AND previous versions;
- 8.6.8 when built on a 10.13 SDK, with the same Python versions.

For 8.6.8 built on Mojave SDK, there's the black background console window 
issue and for 8.6.9.1 the IDLE's problem showing a little black window.
I've seen no crashes yet with 8.5.18, 8.6.8, 8.6.9 (on my Mac).

--

___
Python tracker 

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



[issue31446] _winapi.CreateProcess (used by subprocess) is not thread-safe

2018-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 7b36016a15aeed0d76a4c05a66203e6d7723aace by Serhiy Storchaka 
(Vladimir Matveev) in branch 'master':
bpo-31446: Copy command line that should be passed to CreateProcessW(). 
(GH-11141)
https://github.com/python/cpython/commit/7b36016a15aeed0d76a4c05a66203e6d7723aace


--

___
Python tracker 

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



[issue31446] _winapi.CreateProcess (used by subprocess) is not thread-safe

2018-12-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +10378

___
Python tracker 

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



[issue35488] pathlib Path.match does not behave as described

2018-12-14 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue35489] Argument Clinic should use "const Py_UNICODE *" for the Py_UNICODE converter

2018-12-14 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Format units "Z" and "Z#" in PyArg_Parse* return a pointer to immutable 
internal data. Therefor the result of the Py_UNICODE converter in Argument 
Clinic should has type "const Py_UNICODE *".

This would help to catch the bug reported in issue31446.

--
assignee: serhiy.storchaka
components: Argument Clinic
messages: 331787
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Argument Clinic should use "const Py_UNICODE *" for the Py_UNICODE 
converter
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue35489] Argument Clinic should use "const Py_UNICODE *" for the Py_UNICODE converter

2018-12-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +10379
stage:  -> patch review

___
Python tracker 

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



[issue31446] _winapi.CreateProcess (used by subprocess) is not thread-safe

2018-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 922b2a0d0d9928af420ea4d5c104f8be72517aa2 by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-31446: Copy command line that should be passed to CreateProcessW(). 
(GH-11141). (GH-11149)
https://github.com/python/cpython/commit/922b2a0d0d9928af420ea4d5c104f8be72517aa2


--

___
Python tracker 

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



[issue35489] Argument Clinic should use "const Py_UNICODE *" for the Py_UNICODE converter

2018-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset afb3e71a1710c444fbe789b51df43ee16ee9ede7 by Serhiy Storchaka in 
branch 'master':
bpo-35489: Use "const Py_UNICODE *" for the Py_UNICODE converter in AC. 
(GH-11150)
https://github.com/python/cpython/commit/afb3e71a1710c444fbe789b51df43ee16ee9ede7


--

___
Python tracker 

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



[issue35489] Argument Clinic should use "const Py_UNICODE *" for the Py_UNICODE converter

2018-12-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +10380

___
Python tracker 

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



[issue31446] _winapi.CreateProcess (used by subprocess) is not thread-safe

2018-12-14 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



[issue35490] Remove the DecodeFSDefault return converter in Argument Clinic

2018-12-14 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The DecodeFSDefault return converter is used only in one function, 
os.ttyname(). It could be used also in os.ctermid(), but in any case there are 
too small use cases for it, because it is very uncommon to return a bare 
pointer to static C string. Since it is such uncommon and using this return 
converter does not add much to readability, I think that it is better to remove 
it.

--
components: Argument Clinic
messages: 331790
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Remove the DecodeFSDefault return converter in Argument Clinic

___
Python tracker 

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



[issue35490] Remove the DecodeFSDefault return converter in Argument Clinic

2018-12-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +10381
stage:  -> patch review

___
Python tracker 

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



[issue35488] pathlib Path.match does not behave as described

2018-12-14 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Is this similar to issue29249 (See also msg285311) and issue34731 ? As I can 
see in Lib/test/test_pathlib.py there are also no tests for "**" and I think 
it's good to add one along with documenting it.

--

___
Python tracker 

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



[issue35489] Argument Clinic should use "const Py_UNICODE *" for the Py_UNICODE converter

2018-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 45a7b7617e67bd1a8491f5e10ea9d24fe418b52d by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-35489: Use "const Py_UNICODE *" for the Py_UNICODE converter in AC. 
(GH-11150). (GH-11151)
https://github.com/python/cpython/commit/45a7b7617e67bd1a8491f5e10ea9d24fe418b52d


--

___
Python tracker 

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



[issue35489] Argument Clinic should use "const Py_UNICODE *" for the Py_UNICODE converter

2018-12-14 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



[issue35478] multiprocessing: ApplyResult.get() hangs if the pool is terminated

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

Attached PR 11139 sets RuntimeError("Pool terminated") error in pending results 
if the pool is terminated.

--

___
Python tracker 

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



[issue35479] multiprocessing.Pool.join() always takes at least 100 ms

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

My PR 11136 doesn't work: _maintain_pool() should be called frequently to check 
when a worker completed. Polling worker exit status seems inefficient :-(

asyncio uses SIGCHLD signal to be notified when a child process completes. 
SafeChildWatcher calls os.waitpid(pid, os.WNOHANG) on each child process, 
whereas FastChildWatcher() uses os.waitpid(-1, os.WNOHANG).

--

___
Python tracker 

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



[issue35491] multiprocessing: enhance repr()

2018-12-14 Thread STINNER Victor


New submission from STINNER Victor :

multiprocessing.Pool has no __repr__() method, 
multiprocessing.BaseProcess.__repr__() doesn't contain the pid.

I propose to enhance repr() in the multiprocessing module to ease debug.

commit 2b417fba25f036c2d6139875e389d80e4286ad75 (HEAD -> master, 
upstream/master)
Author: Victor Stinner 
Date:   Fri Dec 14 11:13:18 2018 +0100

Add multiprocessing.Pool.__repr__() (GH-11137)

* Add multiprocessing.Pool.__repr__() to ease debug
* RUN, CLOSE and TERMINATE constants values are now strings rather
  than integer to ease debug

--
components: Library (Lib)
messages: 331795
nosy: vstinner
priority: normal
severity: normal
status: open
title: multiprocessing: enhance repr()
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



[issue35491] multiprocessing: enhance repr()

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +10382
stage:  -> patch review

___
Python tracker 

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



[issue35491] multiprocessing: enhance repr() to ease debugging

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
title: multiprocessing: enhance repr() -> multiprocessing: enhance repr() to 
ease debugging

___
Python tracker 

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



[issue35492] Missing colon on func statement in library/sys doc

2018-12-14 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +10383
stage:  -> patch review

___
Python tracker 

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



[issue35492] Missing colon on func statement in library/sys doc

2018-12-14 Thread Jules Lasne


New submission from Jules Lasne :

As you can see here, a `:` is missing for the href to be created. 
https://docs.python.org/3/library/sys.html#sys.get_coroutine_origin_tracking_depth

--
assignee: docs@python
components: Documentation
messages: 331796
nosy: docs@python, mdk, seluj78
priority: normal
severity: normal
status: open
title: Missing colon on func statement in library/sys doc
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



[issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit

2018-12-14 Thread STINNER Victor


New submission from STINNER Victor :

Currently, multiprocessing.Pool._worker_handler() checks every 100 ms if a 
worker exited using time.sleep(0.1). It causes a latency if worker exit 
frequently and the pool has to execute a large number of tasks.

Worst case:
---
import multiprocessing
import time
CONCURRENCY = 1
NTASK = 100
def noop():
pass
with multiprocessing.Pool(CONCURRENCY, maxtasksperchild=1) as pool:
start_time = time.monotonic()
results = [pool.apply_async(noop, ()) for _ in range(NTASK)]
for result in results:
result.get()
dt = time.monotonic() - start_time
pool.terminate()
pool.join()
print("Total: %.1f sec" % dt)
---

Output:
---
Total: 10.2 sec
---

The worst case is a pool of 1 process, each worker only executes a single task 
and the task does nothing (minimize task execution time): the latency is 100 ms 
per task, which means 10 seconds for 100 tasks.

Using SIGCHLD signal to be notified when a worker completes would allow to 
avoid polling: reduce the latency and reduce CPU usage (the thread doesn't have 
to be awaken every 100 ms anymore).

--
components: Library (Lib)
messages: 331797
nosy: davin, pablogsal, pitrou, vstinner
priority: normal
severity: normal
status: open
title: multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on 
worker exit
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



[issue35492] Missing colon on func statement in library/sys doc

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


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



[issue35492] Missing colon on func statement in library/sys doc

2018-12-14 Thread miss-islington


miss-islington  added the comment:


New changeset cb0f5e29e37c081e9bba91a9858370e2504e9e8e by Miss Islington (bot) 
(Jules Lasne (jlasne)) in branch 'master':
Fixed missing colun in library/sys.po (GH-11153)
https://github.com/python/cpython/commit/cb0f5e29e37c081e9bba91a9858370e2504e9e8e


--
nosy: +miss-islington

___
Python tracker 

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



[issue35492] Missing colon on func statement in library/sys doc

2018-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10385

___
Python tracker 

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



[issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

asyncio uses SIGCHLD signal to be notified when a child process completes. 
SafeChildWatcher calls os.waitpid(pid, os.WNOHANG) on each child process, 
whereas FastChildWatcher() uses os.waitpid(-1, os.WNOHANG).

--

___
Python tracker 

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



[issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-35479: multiprocessing.Pool.join() always takes at least 100 ms.

--

___
Python tracker 

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



[issue35479] multiprocessing.Pool.join() always takes at least 100 ms

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

> My PR 11136 doesn't work: _maintain_pool() should be called frequently to 
> check when a worker completed. Polling worker exit status seems inefficient 
> :-(

I created bpo-35493: "multiprocessing.Pool._worker_handler(): use SIGCHLD to be 
notified on worker exit".

--

___
Python tracker 

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



[issue35492] Missing colon on func statement in library/sys doc

2018-12-14 Thread miss-islington


miss-islington  added the comment:


New changeset 527008599dca9377aa3e71da5e5068433aee by Miss Islington (bot) 
in branch '3.7':
Fixed missing colun in library/sys.po (GH-11153)
https://github.com/python/cpython/commit/527008599dca9377aa3e71da5e5068433aee


--

___
Python tracker 

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



[issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit

2018-12-14 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

How do you use SIGCHLD on Windows?

There is actually a portable (and robust) solution: use Process.sentinel
https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Process.sentinel

There is another issue: Pool is currently subclassed by ThreadPool. You'll 
probably have to make the two implementations diverge a bit.

--

___
Python tracker 

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



[issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

> How do you use SIGCHLD on Windows?

I'm only proposing to use a signal when it's available, on UNIX. So have 
multiple implementations of the function, depending on the ability to get 
notified on completion without polling.

On Windows, maybe we could use a dedicated thread to set an event once 
WaitForSingleObject/WaitForMultipleObjects completes?

The design of my bpo-35479 change is to replace polling with one or multiple 
events. Maybe we can use an event to wakeup _worker_handler() when something 
happens, but have different wants to signal this event.

I have to investigate how Process.sentinel can be used here.

I might be interesting to use asyncio internally, but I'm not sure if it's 
possible ;-)

--

___
Python tracker 

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



[issue35479] multiprocessing.Pool.join() always takes at least 100 ms

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

_worker_handler has two issues:

* It polls the worker status every status every 100 ms: I created bpo-35493 to 
investigate how to avoid that
* After close() or terminate() has been called, it loops until self._cache is 
empty. I would like to use result.wait(), but a result never completes after 
terminate(): I created bpo-35478 to see if tasks can be unblocked in that case 
(to ensure that result.wait() completes after terminate().

--
dependencies: +multiprocessing.Pool._worker_handler(): use SIGCHLD to be 
notified on worker exit, multiprocessing: ApplyResult.get() hangs if the pool 
is terminated

___
Python tracker 

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



[issue35491] multiprocessing: enhance repr() to ease debugging

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7acd50ad8b2a4fe132f7b26980ed3cd209b7ea12 by Victor Stinner in 
branch 'master':
bpo-35491: Enhance multiprocessing.BaseProcess.__repr__() (GH-11138)
https://github.com/python/cpython/commit/7acd50ad8b2a4fe132f7b26980ed3cd209b7ea12


--

___
Python tracker 

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



[issue35491] multiprocessing: enhance repr() to ease debugging

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit

2018-12-14 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Using asyncio internally would be an interesting long-term goal, at least for 
the process pool version.

Perhaps a first step is to find out how to await a multiprocessing Connection 
or Queue, or make async versions of these classes.

--

___
Python tracker 

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



[issue35412] test_future4 ran no test

2018-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10387

___
Python tracker 

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



[issue34279] RFC: issue a warning in regrtest when no tests have been executed?

2018-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10386

___
Python tracker 

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



[issue34279] RFC: issue a warning in regrtest when no tests have been executed?

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3a8f4fef4a4dd0e4a800545468eef9542e126181 by Victor Stinner in 
branch 'master':
bpo-34279: regrtest consider that skipped tests are ran (GH-11132)
https://github.com/python/cpython/commit/3a8f4fef4a4dd0e4a800545468eef9542e126181


--

___
Python tracker 

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



[issue34279] RFC: issue a warning in regrtest when no tests have been executed?

2018-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10388

___
Python tracker 

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



[issue35412] test_future4 ran no test

2018-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10389

___
Python tracker 

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



[issue2661] Mapping tests cannot be passed by user implementations

2018-12-14 Thread Walter Dörwald

Change by Walter Dörwald :


--
pull_requests: +10390
stage: needs patch -> patch review

___
Python tracker 

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



[issue35412] test_future4 ran no test

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 3a8f4fef4a4dd0e4a800545468eef9542e126181 by Victor Stinner in 
branch 'master':
bpo-34279: regrtest consider that skipped tests are ran (GH-11132)
https://github.com/python/cpython/commit/3a8f4fef4a4dd0e4a800545468eef9542e126181


--

___
Python tracker 

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



[issue35493] multiprocessing.Pool._worker_handler(): use SIGCHLD to be notified on worker exit

2018-12-14 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

> I have to investigate how Process.sentinel can be used here.

Look how concurrent.futures uses it:
https://github.com/python/cpython/blob/master/Lib/concurrent/futures/process.py#L348

This also means:
1) we could redirect people to ProcessPoolExecutor instead of trying to 
backport all its features into multiprocessing.Pool
2) we could try to refactor the ProcessPoolExecutor implementation into a 
common backend for both ProcessPoolExecutor and multiprocessing.Pool

--

___
Python tracker 

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



[issue2661] Mapping tests cannot be passed by user implementations

2018-12-14 Thread Walter Dörwald

Walter Dörwald  added the comment:

OK, I've created the pull request (11157).

--

___
Python tracker 

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



[issue34279] RFC: issue a warning in regrtest when no tests have been executed?

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10393

___
Python tracker 

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



[issue35412] test_future4 ran no test

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10394

___
Python tracker 

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



[issue35346] Modernize Lib/platform.py code

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4aa917c5feaec07a6f6db87b34185ab6180e20ee by Victor Stinner in 
branch 'master':
bpo-35346: Cleanup platform.architecture() (GH-11130)
https://github.com/python/cpython/commit/4aa917c5feaec07a6f6db87b34185ab6180e20ee


--

___
Python tracker 

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



[issue35346] Modernize Lib/platform.py code

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

I close the issue. I made that changes that I wanted :-)

Serhiy: reopen the issue or open a new one if you want to remove the try/except 
ImportError around "import plistlib".

--
dependencies:  -Problems with handling the file command output in 
platform.architecture()
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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

I removed the dependency between bpo-35346 and this issue. I don't see how they 
are related.

--

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

> I agreed with Serhiy. I also found the function decode the output with 
> latin-1, I think it will be better to use utf-8 instead.

Decoding from UTF-8 can fail with UnicodeDecodeError, whereas decoding from 
latin-1 never fails.

file output is ASCII, so I don't see the point of using UTF-8.

Currently, the command displays the filename, but I don't think that we should 
care of the encoding of the filename.

> I think that the "-b" option should be restored.

That, or strip/skip the filename in the output?

--

___
Python tracker 

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



[issue34279] RFC: issue a warning in regrtest when no tests have been executed?

2018-12-14 Thread miss-islington


miss-islington  added the comment:


New changeset 5f252e1ebc098fff7f88fbf89d203b1dd15fe7fa by Miss Islington (bot) 
in branch '3.7':
bpo-34279: regrtest consider that skipped tests are ran (GH-11132)
https://github.com/python/cpython/commit/5f252e1ebc098fff7f88fbf89d203b1dd15fe7fa


--

___
Python tracker 

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



[issue35412] test_future4 ran no test

2018-12-14 Thread miss-islington


miss-islington  added the comment:


New changeset 5f252e1ebc098fff7f88fbf89d203b1dd15fe7fa by Miss Islington (bot) 
in branch '3.7':
bpo-34279: regrtest consider that skipped tests are ran (GH-11132)
https://github.com/python/cpython/commit/5f252e1ebc098fff7f88fbf89d203b1dd15fe7fa


--

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +10395
stage:  -> patch review

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

-b option added by:
https://hg.python.org/cpython/rev/c73b90b6dadd

and removed the day after by:
https://hg.python.org/cpython/rev/b94a9ff13199

--

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

> -b option added by:
> https://hg.python.org/cpython/rev/c73b90b6dadd

Oh wait, this change is for the 2.7 branch. The change in master (old "default" 
branch) didn't add -b, but replaced "-b" with "-b --":
https://hg.python.org/cpython/rev/cd026866b333

--

___
Python tracker 

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



[issue35471] Remove macpath module

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d7538dd5e3e04a8db22e1470cb2ed696bf3be160 by Victor Stinner in 
branch 'master':
bpo-35471: Remove the macpath module (GH-11129)
https://github.com/python/cpython/commit/d7538dd5e3e04a8db22e1470cb2ed696bf3be160


--

___
Python tracker 

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



[issue35471] Remove macpath module

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35424] multiprocessing.Pool: emit ResourceWarning

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

See this discussion:
[Python-Dev] Usage of the multiprocessing API and object lifetime
https://mail.python.org/pipermail/python-dev/2018-December/155946.html

--

___
Python tracker 

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



[issue35412] test_future4 ran no test

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 34b7c438b8dc0a1e7e23c9b2d7ce7f8a7c31b4f4 by Victor Stinner in 
branch '2.7':
bpo-34279: regrtest consider that skipped tests are ran (GH-11132) (GH-11158)
https://github.com/python/cpython/commit/34b7c438b8dc0a1e7e23c9b2d7ce7f8a7c31b4f4


--

___
Python tracker 

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



[issue34279] RFC: issue a warning in regrtest when no tests have been executed?

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 34b7c438b8dc0a1e7e23c9b2d7ce7f8a7c31b4f4 by Victor Stinner in 
branch '2.7':
bpo-34279: regrtest consider that skipped tests are ran (GH-11132) (GH-11158)
https://github.com/python/cpython/commit/34b7c438b8dc0a1e7e23c9b2d7ce7f8a7c31b4f4


--

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I tested that the "-b" option is supported on Linux, *BSD and OpenIndiana. But 
it is not a part of POSIX. So perhaps we should fall back to "file" without 
"-b" if "file -b" failed.

We can also check that the output starts with executable+': ' and strip this 
prefix.

--

___
Python tracker 

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



[issue35494] Inaccurate error message for f-string

2018-12-14 Thread Sebastian Linke


New submission from Sebastian Linke :

Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> spam = 'spam'
>>> f'{spam[0}'
  File "", line 1
SyntaxError: f-string: expecting '}'

The error message seems wrong because a "]" is missing rather than a "}".

--
components: Interpreter Core
messages: 331827
nosy: seblin
priority: normal
severity: normal
status: open
title: Inaccurate error message for f-string
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



[issue35494] Inaccurate error message for f-string

2018-12-14 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith
nosy: +eric.smith

___
Python tracker 

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



[issue35494] Inaccurate error message for f-string

2018-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I can take this issue if you do not mind.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

In 2.7 branch, _syscmd_file() only used -b option during one day (no Python 
2.7.x release used -b):

* Oct 4, 2012: commit 95038fa526c8b93e42c59b0735edf1c80b7b6449 added -b: 
"Closes #16112: platform.architecture does not correctly escape argument to 
/usr/bin/file"
* Oct 5, 2012: commit 2699c9d24810196a07e0577215ec3beb7ecfb55b removed -b: 
"#16112: platform.architecture does not correctly escape argument to 
/usr/bin/file. Fix original patch"

Python 3.2.0 (Feb 2011) to 3.2.3 (Sep 2012) and Python 3.3.0 (Sep 2012) used -b:

* Aug 13, 2010: commit ddfb2c3a338a8c1550774648f816e96c41f59de1 added -b: "Omit 
the filename to avoid enconding issues, especially with non encodable 
characters in the Python full path."
* Oct 5, 2012: commit 685fffa8f427b3a768b232170752565d58c32112 removed -b: 
"#16112: platform.architecture does not correctly escape argument to 
/usr/bin/file. Fix original patch"

--

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

> We can also check that the output starts with executable+': ' and strip this 
> prefix.

Technically, on UNIX, ':' is valid in a filename. Filename examples which 
contain ':' on my Fedora 29:

/usr/share/man/man3/List::Util.3pm.gz
/usr/share/usb_modeswitch/0408:f000
/proc/irq/127/ahci[:00:17.0]
/proc/irq/131/snd_hda_intel:card0
/dev/block/259:3
/sys/kernel/slab/:0002632
/sys/module/psmouse/drivers/serio:psmouse

Note: I cannot find a program name which contains ':'.

--

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

A convervative approach would be to leave stable branches unchanged and use -b 
in the master branch.

--

___
Python tracker 

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



[issue35494] Inaccurate error message for f-string

2018-12-14 Thread Eric V. Smith


Eric V. Smith  added the comment:

Go ahead, Serhiy. Thanks!

--
assignee: eric.smith -> serhiy.storchaka

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +10396

___
Python tracker 

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



[issue35494] Inaccurate error message for f-string

2018-12-14 Thread Sebastian Linke


Sebastian Linke  added the comment:

The same behavior applies to f'{spam[}' and f'{spam(}'. Also to f'{spam{}', but 
that might be expected.

This message is more clear:
>>> f'{spam('
  File "", line 1
SyntaxError: f-string: mismatched '(', '{', or '['

Perhaps you want to apply that to the above error cases. Then you wouldn't have 
to catch any type of bracket. :-)

--

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 11160 is an alternate solution which strips the filename in the output. It 
does not matter if the filename contains ":", because the format of the output 
in the POSIX locale is strictly specified.

--

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

BTW. A related problem with platform.architecture() is that it doesn't know how 
to deal with fat binaries (such as those found on macOS).

As an example:

$  file /usr/bin/python
/usr/bin/python: Mach-O universal binary with 2 architectures: [i386:Mach-O 
executable i386] [x86_64:Mach-O 64-bit executable x86_64]
/usr/bin/python (for architecture i386):Mach-O executable i386
/usr/bin/python (for architecture x86_64):  Mach-O 64-bit executable x86_64

This will be reported as "64-bit" by platform.architecture() because there is 
'64-bit' in the output of file(1).

Using sizeof(void*) or sys.maxsize suffers from the a simular problem: this 
will only detect the pointer-size of the current proces and not that the binary 
is capable of running with a different pointer-size as well. 

P.S. platform.architecture() uses file(1) because you can specify different 
executables than sys.executable.

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What result of platform.architecture() do you expect for an universal binary?

--

___
Python tracker 

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



[issue35495] argparse does not honor default argument for nargs=argparse.REMAINDER argument

2018-12-14 Thread Ryan Govostes


New submission from Ryan Govostes :

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('things', nargs=argparse.REMAINDER, default=['nothing'])
parser.parse_args([])
>>> Namespace(things=[])

Since there were no unparsed arguments remaining, the `default` setting for 
`things` should have been honored. However it silently ignores this setting.

If there's a reason why this wouldn't be desirable, it should raise an 
exception that the options aren't compatible.

--
components: Library (Lib)
messages: 331837
nosy: rgov
priority: normal
severity: normal
status: open
title: argparse does not honor default argument for nargs=argparse.REMAINDER 
argument
type: behavior

___
Python tracker 

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



[issue35495] argparse does not honor default argument for nargs=argparse.REMAINDER argument

2018-12-14 Thread Ryan Govostes


Change by Ryan Govostes :


--
versions: +Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue35496] left-to-right violation in match order

2018-12-14 Thread Steve Newcomb


New submission from Steve Newcomb :

Documentation for the re module insists that matches are made left-to-right 
within the alternatives delimited by an "or* | group.  I seem to have found a 
case where the rightmost alternative is matched unless it (and only it) is 
commented out.  See attached script, which is self-explanatory.

--
files: left-to-right_violation_in_python3_re_match.py
messages: 331838
nosy: steve.newcomb
priority: normal
severity: normal
status: open
title: left-to-right violation in match order
type: behavior
versions: Python 3.6
Added file: 
https://bugs.python.org/file47997/left-to-right_violation_in_python3_re_match.py

___
Python tracker 

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



[issue35494] Inaccurate error message for f-string

2018-12-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +10397
stage:  -> patch review

___
Python tracker 

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



[issue35494] Inaccurate error message for f-string

2018-12-14 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 11161 uses an approach similar to issue33306.

--
dependencies: +Improving SyntaxError for unmatched parentheses

___
Python tracker 

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



[issue35494] Inaccurate error message for f-string

2018-12-14 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type:  -> enhancement
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue35497] Libary select docs enhance

2018-12-14 Thread Manjusaka


New submission from Manjusaka :

Since Python 3.7, Python adds a mask variable named EPOLLEXCLUSIVE for 
select.epoll. The mask variable is supported by the Linux Kernel since Kernel 
4.5. So we can add a tip in this part of Python docs to notice the people the 
case.

--
components: Library (Lib)
messages: 331840
nosy: Manjusaka
priority: normal
severity: normal
status: open
title: Libary select docs enhance
type: enhancement
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



[issue35497] Libary select docs enhance

2018-12-14 Thread Manjusaka


Change by Manjusaka :


--
keywords: +patch
pull_requests: +10398
stage:  -> patch review

___
Python tracker 

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



[issue35498] Parents objects in pathlib.Path don't support slices as __getitem__ arguments

2018-12-14 Thread Joshua Cannon


New submission from Joshua Cannon :

I would expect the following to work:
```
>>> import pathlib
>>> pathlib.Path.cwd().parents[0:1]
Traceback (most recent call last):
  File "", line 1, in 
  File "...\Python36\lib\pathlib.py", line 593, in __getitem__
if idx < 0 or idx >= len(self):
TypeError: '<' not supported between instances of 'slice' and 'int'
```

Since pathlib documents `parents` as a sequence-type, and slicing a sequence is 
pretty standard behavior.

--
components: Library (Lib)
messages: 331841
nosy: thejcannon
priority: normal
severity: normal
status: open
title: Parents objects in pathlib.Path don't support slices as __getitem__ 
arguments
type: enhancement
versions: Python 3.6

___
Python tracker 

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



[issue35412] test_future4 ran no test

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35402] Upgrade macOS and Windows installers to Tcl 8.6.9 and Tk 8.6.9.1

2018-12-14 Thread Steve Dower


Steve Dower  added the comment:


New changeset f8e9bd568adf85c1e4aea1dda542a96b027797e2 by Steve Dower in branch 
'master':
bpo-35402: Update Windows build to use Tcl and Tk 8.6.9 (GH-11146)
https://github.com/python/cpython/commit/f8e9bd568adf85c1e4aea1dda542a96b027797e2


--

___
Python tracker 

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



[issue35402] Upgrade macOS and Windows installers to Tcl 8.6.9 and Tk 8.6.9.1

2018-12-14 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10399

___
Python tracker 

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



[issue35348] Problems with handling the file command output in platform.architecture()

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

I don't understand the purpose of the 'linkage' information of 
platform.architecture(). Does anyone care if Python is an ELF program or a 
WindowsPE program? Maybe it was useful 20 years ago when there were COFF on 
Unix, but right now ELF is the defacto standard on Unix, and WindowsPE on 
Windows.

32-bit and 64-bit information should be enough, no?

I would suggest to just return ('%sbit' % bits, '') if executable is not set. 
Use struct.calcsize('P')*8 or sys.maxsize to get bits.

--

___
Python tracker 

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



[issue35402] Upgrade macOS and Windows installers to Tcl 8.6.9 and Tk 8.6.9.1

2018-12-14 Thread Steve Dower


Steve Dower  added the comment:


New changeset 77824ef6e50e8a47a0b57df2d9f3b48bffd414ac by Steve Dower (Miss 
Islington (bot)) in branch '3.7':
bpo-35402: Update Windows build to use Tcl and Tk 8.6.9 (GH-11146)
https://github.com/python/cpython/commit/77824ef6e50e8a47a0b57df2d9f3b48bffd414ac


--

___
Python tracker 

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



[issue35257] Avoid leaking linker flags into distutils: add PY_LDFLAGS_NODIST

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

There are multiple ways to configure and build Python, we should try most 
combinations:

* ./configure --enable-shared
* ./configure --with-lto
* ./configure --enable-optimizations
* make profile-opt
* make
* Maybe also: make install

Test:

* Build Python and make sure that python binary and C extensions (of the 
stdlib) are compiled with LTO
* python-config --cflags and python-config --ldflags don't leak LTO flags
* Build a C extension (Pillow) and check that there is no LTO flag in the 
command lines

I'm not how to test cross-compilation :-(

--

___
Python tracker 

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



[issue27715] call-matcher breaks if a method is mocked with spec=True

2018-12-14 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I think the original issue with patch.object reported by Carl is different from 
the one reported by David for autospec. Analyzed the report by David and When 
we call autospec on a class with instance=True then the spec is modeled on the 
signature of __call__ instead of __init__ where __call__ has the signature of 
(self, x) and self is  discarded with _eat_self passed as True. But mock also 
stores _spec_signature that is not aware of skipping self and has the signature 
as (self, x) and is used for checking signature in mock.assert_called_with. 
When instance=True then kwargs['_spec_as_instance']=True so does it makes sense 
to set kwargs['_eat_self'] = True at [0] ? I applied the change and there are 
no test failures so this deserves a test.

This makes __call__ to have a different signature when it's called from mock 
and when the call is checked with assert_called_with_once. But it's not the 
case for methods of the class where self is skipped both for mock and 
_spec_signature. Since __signature__ is set for mock with my PR this makes it 
little easy to debug. Can this be dealt as a separate issue?

I would also love to see if the assertion message can be improved since 
expected_call and actual_call are printed with repr version of the call object 
in spite of the signature failure. This has caused confusion here and in other 
places like issue26752 and issue25312.

Sample program to demonstrate difference in signatures :  

import inspect
from unittest import mock

class Foo:

def __call__(self, x):
return x

def bar(self, x):
pass

m = mock.create_autospec(Foo, instance=True)
m(7)
m.bar(7)
print(inspect.signature(m))
print(m._spec_signature)
print(inspect.signature(m.bar))
print(m.bar._spec_signature)
m.bar.assert_called_once_with(7) # 7 passed as self with no value for x
m.assert_called_once_with(7) # Fails due to self

(x)
(self, x) # self is not skipped in _spec_signature
(x)
(x)
TypeError: missing a required argument: 'x'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "../backups/bpo27715_1.py", line 20, in 
m.assert_called_once_with(7)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", 
line 840, in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", 
line 827, in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: Expected call: mock(7)
Actual call: mock(7)


[0] 
https://github.com/python/cpython/blob/f8e9bd568adf85c1e4aea1dda542a96b027797e2/Lib/unittest/mock.py#L2199

--
nosy: +cjw296, mariocj89
versions:  -Python 3.6

___
Python tracker 

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



[issue35499] "make profile-opt" overrides CFLAGS_NODIST

2018-12-14 Thread STINNER Victor


New submission from STINNER Victor :

Makefile.pre.in contains the rule:

build_all_generate_profile:
$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" 
LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"

I'm not sure that CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" is correct: it 
overrides user $CFLAGS_NODIST variable. I suggest to replace it with 
CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)": add $(PGO_PROF_GEN_FLAG) 
to CFLAGS_NODIST, don't copy $CFLAGS to $CFLAGS_NODIST (and add 
$(PGO_PROF_GEN_FLAG)).

The code comes from bpo-23390:

commit 2f90aa63666308e7a9b2d0a89110e0be445a393a
Author: Gregory P. Smith 
Date:   Wed Feb 4 02:11:56 2015 -0800

Fixes issue23390: make profile-opt causes -fprofile-generate and related 
flags
to end up in distutils CFLAGS.

(...)
 build_all_generate_profile:
-   $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
+   $(MAKE) all CFLAGS_NODIST="$(CFLAGS) -fprofile-generate" 
LDFLAGS="-fprofile-generate" LIBS="$(LIBS) -lgcov"
(...)


CFLAGS_NODIST has been added by bpo-21121:

commit acb8c5234302f8057b331abaafb2cc8697daf58f
Author: Benjamin Peterson 
Date:   Sat Aug 9 20:01:49 2014 -0700

add -Werror=declaration-after-statement only to stdlib extension modules 
(closes #21121)

Patch from Stefan Krah.


This issue is related to bpo-35257: "Avoid leaking linker flags into distutils: 
add PY_LDFLAGS_NODIST".

--
components: Build
messages: 331847
nosy: vstinner
priority: normal
severity: normal
status: open
title: "make profile-opt" overrides CFLAGS_NODIST
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue26415] Excessive peak memory consumption by the Python parser

2018-12-14 Thread A. Skrobov


A. Skrobov  added the comment:

I've run pyperformance (0.7.0) with my updated patch, and posted results at the 
PR page. They look encouraging enough.

--

___
Python tracker 

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



[issue35499] "make profile-opt" overrides CFLAGS_NODIST

2018-12-14 Thread STINNER Victor


Change by STINNER Victor :


--
keywords: +patch
pull_requests: +10400
stage:  -> patch review

___
Python tracker 

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



[issue35500] Align expected and actual calls on mock.assert_called_with error message

2018-12-14 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

Currently, assert_called_with has expected calls list in the same line with 
AssertionError that causes the visualizing the difference to be hard. It will 
be great if Expected call occurs on the next line so that the diff is improved. 
The change has to be made at 
https://github.com/python/cpython/blob/f8e9bd568adf85c1e4aea1dda542a96b027797e2/Lib/unittest/mock.py#L749
 .

from unittest import mock

m = mock.Mock()
m(1, 2)
m.assert_called_with(2, 3)

Current output : 

Traceback (most recent call last):
  File "/tmp/bar.py", line 5, in 
m.assert_called_with(2, 3)
  File 
"/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/unittest/mock.py",
 line 820, in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: Expected call: mock(2, 3)
Actual call: mock(1, 2)

Proposed output : 

Traceback (most recent call last):
  File "/tmp/bar.py", line 5, in 
m.assert_called_with(2, 3)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/unittest/mock.py", 
line 827, in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError:
Expected call: mock(2, 3)
Actual call: mock(1, 2)

Some more alignment with the call list starting in the same column

AssertionError:
Expected call: mock(2, 3)
Actual call:   mock(1, 2)


Originally reported in the GitHub repo at 
https://github.com/testing-cabal/mock/issues/424 . PR for this was closed since 
GitHub is used only for backporting 
(https://github.com/testing-cabal/mock/pull/425). I thought to report it here 
for discussion. Currently call list output is as per proposed output.

AssertionError: Calls not found.
Expected: [call(1, 2, 3)]
Actual: [call(1, 2)].

--
components: Library (Lib)
messages: 331849
nosy: cjw296, mariocj89, michael.foord, xtreak
priority: normal
severity: normal
status: open
title: Align expected and actual calls on mock.assert_called_with error message
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



[issue35501] "make coverage" should use leak coverage flags to third party C extensions

2018-12-14 Thread STINNER Victor


New submission from STINNER Victor :

"make coverage" modifies CFLAGS and LIBS, Makefile.pre.in:

coverage:
@echo "Building with support for coverage checking:"
$(MAKE) clean profile-removal
$(MAKE) @DEF_MAKE_RULE@ CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs 
-ftest-coverage" LIBS="$(LIBS) -lgcov"

CFLAGS_NODIST should be used instead here. I'm not sure about LIBS: do we need 
LIBS_NODIST, as we have CFLAGS_NODIST? LIBS_NODIST would be used for Python and 
C extensions of the stdlib, but not for third-party C extensions: not used by 
distutils.


See also bpo-35257: "Avoid leaking linker flags into distutils: add 
PY_LDFLAGS_NODIST".

--
components: Build
messages: 331850
nosy: vstinner
priority: normal
severity: normal
status: open
title: "make coverage" should use leak coverage flags to third party C 
extensions
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



[issue35499] "make profile-opt" overrides CFLAGS_NODIST

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 11164 to fix the issue.

Example:

$ git clean -fdx
$ ./configure --with-pydebug
$ make profile-opt CFLAGS_NODIST="-O1"
(...)
gcc -pthread -c -Wno-unused-result -Wsign-compare -g -Og -Wall-std=c99 
-Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-fprofile-generate -I./Include/internal  -I. -I./Include-DPy_BUILD_CORE -o 
Programs/python.o ./Programs/python.c
(...)

=> CFLAGS_NODIST is missing: I don't see -O1 in the command line.


With my change:

$ git clean -fdx
$ ./configure --with-pydebug
$ make profile-opt CFLAGS_NODIST="-O1"
(...)
gcc -pthread -c -Wno-unused-result -Wsign-compare -g -Og -Wall-std=c99 
-Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration -O1 
-fprofile-generate -I./Include/internal  -I. -I./Include-DPy_BUILD_CORE -o 
Programs/python.o ./Programs/python.c
(...)

=> CFLAGS_NODIST is used: I see "-O1" in the command line.

--

___
Python tracker 

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



[issue35257] Avoid leaking linker flags into distutils: add PY_LDFLAGS_NODIST

2018-12-14 Thread STINNER Victor


STINNER Victor  added the comment:

See also:

* bpo-35499: "make profile-opt" overrides CFLAGS_NODIST 
* bpo-35501: "make coverage" should use leak coverage flags to third party C 
extensions.

--

___
Python tracker 

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



[issue35498] Parents objects in pathlib.Path don't support slices as __getitem__ arguments

2018-12-14 Thread Joshua Cannon


Change by Joshua Cannon :


--
keywords: +patch
pull_requests: +10401
stage:  -> patch review

___
Python tracker 

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



[issue35498] Parents objects in pathlib.Path don't support slices as __getitem__ arguments

2018-12-14 Thread Joshua Cannon


Joshua Cannon  added the comment:

If it is deemed a bug which needs to be fixed, I've gone ahead and attached the 
PR to fix it.

CLA signage is pending approval at the company I work for, with most people out 
for the holidays (so it might be a day or two turnaround).

--

___
Python tracker 

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



[issue35441] Dead (and buggy) code due to mishandling of PyList_SetItem() errors

2018-12-14 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Can this be closed?

--
nosy: +terry.reedy

___
Python tracker 

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



  1   2   >