Minor bug in multiprocessing?

Frank Millman frank at chagford.com
Sat Dec 19 03:38:18 EST 2009


Hi all

This is a minor issue, but I thought I would mention it.

I am on Python 2.6.2. I have 'from __future__ import unicode_literals' at 
the top of my programs.

I am experimenting with multiprocessing, and in particular subclassing the 
Process class.

If I create a subclass and pass "name='test'" as one of the arguments, I get 
the following -

Traceback (most recent call last):
  File "F:\junk\multiprocess\mp5.py", line 37, in <module>
    p = Frank(name='test')
  File "F:\junk\multiprocess\mp5.py", line 18, in __init__
    self.name = name
  File "C:\Python26\lib\multiprocessing\process.py", line 141, in name
    assert isinstance(name, str), 'name must be a string'
AssertionError: name must be a string

If I change the argument to "name=str('test')" there is no error.

For Python 2.x I think the assertion should be "isinstance(name, 
basestring)" to prevent this from happening.

Is this worth reporting, if it has not been reported already?

Thanks

Frank Millman






More information about the Python-list mailing list