[issue7571] Change 'name' of Process - assertion failure if Unicode

Frank Millman report at bugs.python.org
Thu Dec 24 07:48:42 CET 2009


New submission from Frank Millman <frank at chagford.com>:

At the top of my program, I have 'from __future__ import 
unicode_literals'.

I subclassed Process, and passed "name='test'" as an argument. I got 
the following traceback.

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.

----------
components: Library (Lib)
messages: 96849
nosy: frankmillman
severity: normal
status: open
title: Change 'name' of Process - assertion failure if Unicode
type: behavior
versions: Python 2.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7571>
_______________________________________


More information about the Python-bugs-list mailing list