Multiprocessing bug, is information ever omitted from a traceback?

John Ladasky ladasky at my-deja.com
Fri Dec 9 18:14:30 EST 2011


Hi folks,

A tangent off of this thread:

http://groups.google.com/group/comp.lang.python/browse_frm/thread/751b7050c756c995#

I'm programming in Python 2.6 on Ubuntu Linux 10.10, if it matters.

I'm trying to track down a multiprocessing bug. Here's my traceback.
All lines of code referenced in the traceback are in the standard
library code:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in
__bootstrap_inner
    self.run()
  File "/usr/lib/python2.6/threading.py", line 484, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.6/multiprocessing/pool.py", line 284, in
_handle_tasks
    put(task)
TypeError: expected string or Unicode object, NoneType found

Fortunately, I have a working version of my code.  I was trying to add
new features, and only my new code is causing trouble.  This has
allowed me to examine the contexts of task when everything works.

Task is not a string when the program works.  Task is not None when
the program doesn't work.  In fact, task is a deeply-nested tuple.  NO
PART of this tuple ever contains any strings, as far as I can tell.
More details in my original thread.

Now, of course I've seen that the standard traceback shows you the
lines where various steps in a chain of function calls were taken.
The traceback skips over any lines in the code between successive
function calls, and assumes that you can follow along.  No problem, I
can do that.

But when multiprocessing is involved, can this traceback be truncated
in some way, for example when code execution switches over to a
subprocess?  I'm wondering if more code is getting executed after
"put(task)" that I'm not seeing.

Thanks for any information!



More information about the Python-list mailing list