Ticket #5866: modify the python data_writer to check for available space