Project

General

Profile

« Previous | Next » 

Revision 5581

csv2db: Removed no longer needed separate handling of sql.DatabaseErrors, because all recoverable errors caused by COPY FROM (EncodingException and ragged rows) are now handled or avoided

View differences:

csv2db
68 68
            
69 69
            db.set_encoding('LATIN1')
70 70
            load() # try again with new encoding
71
        except sql.DatabaseErrors, e:
72
            if use_copy_from: # first try
73
                exc.print_ex(e, plain=True)
74
                use_copy_from = False
75
                load() # try again with different approach
76
            else: raise
77 71
    else: sql_io.cleanup_table(db, table)
78 72

  
79 73
main()

Also available in: Unified diff