Fix the new assign_binary_data function and import the cStringIO module