def create_detailed_pickling_error(exception, instance):
 attribute = None
 def can_pickle(data):
  try:
   cPickle.dumps(v)
  except:
   return False
  else:
   return True
 if hasattr(instance, '__dict__'):
  for (k, v) in instance.__dict__.iteritems():
   if (not can_pickle(v)):
    attribute = k
    break
 elif isinstance(instance, dict):
  for (k, v) in instance.iteritems():
   if (not can_pickle(v)):
    attribute = k
    break
 elif isinstance(instance, (tuple, list)):
  for (i, v) in enumerate(instance):
   if (not can_pickle(v)):
    attribute = ('index-%s' % i)
    break
 wrapped = DetailedMaybeEncodingError(exception, instance, attribute)
 debug(('Possible encoding error while sending result: %s' % wrapped))
 return wrapped

def create_detailed_pickling_error ( exception , instance ) : attribute = None def can_pickle ( data ) : try : cPickle . dumps ( v ) except : return False else : return True if hasattr ( instance , '__dict__' ) : for ( k , v ) in instance . __dict__ . iteritems ( ) : if ( not can_pickle ( v ) ) : attribute = k break elif isinstance ( instance , dict ) : for ( k , v ) in instance . iteritems ( ) : if ( not can_pickle ( v ) ) : attribute = k break elif isinstance ( instance , ( tuple , list ) ) : for ( i , v ) in enumerate ( instance ) : if ( not can_pickle ( v ) ) : attribute = ( 'index-%s' % i ) break wrapped = DetailedMaybeEncodingError ( exception , instance , attribute ) debug ( ( 'Possible encoding error while sending result: %s' % wrapped ) ) return wrapped
maybeencodingerror - picklingerror: cant pickle dictproxy #8748 .