- Timestamp:
- May 25, 2010 10:50:01 AM (15 years ago)
- Branches:
- axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
- Children:
- da2208a
- Parents:
- 75720ab
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fedd/federation/util.py
r75720ab rb53e1fc 4 4 import string 5 5 import logging 6 import pickle 6 7 7 8 import httplib … … 260 261 else: 261 262 return base 263 264 def find_pickle_problem(o, st=None): 265 """ 266 Debugging routine to figure out what doesn't pickle from a dict full of 267 dicts and lists. It tries to walk down the lists and dicts and pickle each 268 atom. If something fails to pickle, it prints an approximation of a stack 269 trace through the data structure. 270 """ 271 if st is None: st = [ ] 272 273 if isinstance(o, dict): 274 for k, i in o.items(): 275 st.append(k) 276 find_pickle_problem(i, st) 277 st.pop() 278 elif isinstance(o, list): 279 st.append('list') 280 for i in o: 281 find_pickle_problem(i, st) 282 st.pop() 283 else: 284 try: 285 pickle.dumps(o) 286 except pickle.PicklingError, e: 287 print >>sys.stderr, "<PicklingError>" 288 print >>sys.stderr, st 289 print >>sys.stderr, o 290 print >>sys.stderr, e 291 print >>sys.stderr, "</PicklingError>" 292
Note: See TracChangeset
for help on using the changeset viewer.