Adding an attribute to GFF3 file
You are printing the attribute before setting it, that's why it's complaining. So instead of this:

    print(i.attributes['Note']=["Gene description"])


Set it first and then print:

i.attributes['Note']=["Gene description"]
print(i)