Re: [Python-Dev] [Python-checkins] bpo-5001: More-informative multiprocessing error messages (#3079)

https://github.com/python/cpython/commit/bd73e72b4a9f019be514954b1d40e64dc3a...
commit: bd73e72b4a9f019be514954b1d40e64dc3a5e81c branch: master author: Allen W. Smith, Ph.D <drallensmith@users.noreply.github.com> committer: Antoine Pitrou <pitrou@free.fr> date: 2017-08-30T00:52:18+02:00 summary:
... @@ -307,6 +309,10 @@ def imap(self, func, iterable, chunksize=1): )) return result else: + if chunksize < 1: + raise ValueError( + "Chunksize must be 1+, not {0:n}".format( + chunksize)) assert chunksize > 1
It looks like removing this assert statement was missed. --Chris
task_batches = Pool._get_tasks(func, iterable, chunksize) result = IMapIterator(self._cache) @@ -334,7 +340,9 @@ def imap_unordered(self, func, iterable, chunksize=1): )) return result else: - assert chunksize > 1 + if chunksize < 1: + raise ValueError( + "Chunksize must be 1+, not {0!r}".format(chunksize)) task_batches = Pool._get_tasks(func, iterable, chunksize) result = IMapUnorderedIterator(self._cache) self._taskqueue.put(

On Wed, 30 Aug 2017 03:16:42 -0700 Chris Jerdonek <chris.jerdonek@gmail.com> wrote:
https://github.com/python/cpython/commit/bd73e72b4a9f019be514954b1d40e64dc3a...
commit: bd73e72b4a9f019be514954b1d40e64dc3a5e81c branch: master author: Allen W. Smith, Ph.D <drallensmith@users.noreply.github.com> committer: Antoine Pitrou <pitrou@free.fr> date: 2017-08-30T00:52:18+02:00 summary:
... @@ -307,6 +309,10 @@ def imap(self, func, iterable, chunksize=1): )) return result else: + if chunksize < 1: + raise ValueError( + "Chunksize must be 1+, not {0:n}".format( + chunksize)) assert chunksize > 1
It looks like removing this assert statement was missed.
Good catch, thanks. Regards Antoine.

Hi! On Wed, Aug 30, 2017 at 04:32:22PM +0200, Antoine Pitrou <solipsis@pitrou.net> wrote:
On Wed, 30 Aug 2017 03:16:42 -0700 Chris Jerdonek <chris.jerdonek@gmail.com> wrote:
https://github.com/python/cpython/commit/bd73e72b4a9f019be514954b1d40e64dc3a...
commit: bd73e72b4a9f019be514954b1d40e64dc3a5e81c branch: master author: Allen W. Smith, Ph.D <drallensmith@users.noreply.github.com> committer: Antoine Pitrou <pitrou@free.fr> date: 2017-08-30T00:52:18+02:00 summary:
... @@ -307,6 +309,10 @@ def imap(self, func, iterable, chunksize=1): )) return result else: + if chunksize < 1: + raise ValueError( + "Chunksize must be 1+, not {0:n}".format( + chunksize)) assert chunksize > 1
The error condition was changed from `<= 1` to `< 1` -- was it intentional?
Regards Antoine.
Oleg. -- Oleg Broytman http://phdru.name/ phd@phdru.name Programmers don't die, they just GOSUB without RETURN.
participants (3)
-
Antoine Pitrou
-
Chris Jerdonek
-
Oleg Broytman