[issue29868] multiprocessing.dummy missing cpu_count

2017-03-21 Thread John Wiseman

New submission from John Wiseman:

The documentation for the multiprocessing.dummy module says that it "replicates 
the API of multiprocessing."  In Python 2.7, I can import multiprocessing.dummy 
and use the cpu_count function:

$ python2
Python 2.7.12 (default, Oct 29 2016, 19:21:06)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing.dummy as mp
>>> mp.cpu_count()
8

But in Python 3.6, multiprocessing.dummy is missing cpu_count:

$ python3
Python 3.6.0 (default, Mar 21 2017, 13:27:21)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing.dummy as mp
>>> mp.cpu_count()
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: module 'multiprocessing.dummy' has no attribute 'cpu_count'

I would expect that multiprocessing.dummy would have cpu_count, since that 
function is available in multiprocessing, and it's there in Python 2.7.

It looks like it was removed in commit 04842a8, "Remove unused or redundant 
imports in concurrent.futures and multiprocessing" (Florent Xicluna 5 years 
ago).  Maybe the removal was inadvertent?

I realize there are several workarounds, but based on the documentation and the 
behavior of previous versions, I wouldn't have expected this breaking change.

--
components: Library (Lib)
messages: 289950
nosy: johnwiseman
priority: normal
severity: normal
status: open
type: behavior
versions: Python 3.6

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



[issue7476] pipes.quote does not handle zero-length args correctly

2009-12-10 Thread John Wiseman

New submission from John Wiseman :

In python 2.5.2, I believe pipes.quote gives the wrong result for zero-
length arguments.

>>> from pipes import quote
>>> args = ['arg1', '', 'arg3']
>>> print 'mycommand %s' % (' '.join(quote(arg) for arg in args))
mycommand arg1  arg3

I think the result should be something like
mycommand arg1 '' arg3

--
components: Library (Lib)
messages: 96225
nosy: jjwiseman
severity: normal
status: open
title: pipes.quote does not handle zero-length args correctly
type: behavior
versions: Python 2.5

___
Python tracker 
<http://bugs.python.org/issue7476>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com