Changing doc.attrs?

Thank you guys, I had exactly the same problem and the solution posted really saves my day! Cheers.