Project

General

Profile

« Previous | Next » 

Revision 5580

csv2db: Handle EncodingException separately by changing the connection encoding to LATIN1 and retrying

View differences:

bin/csv2db
62 62
    
63 63
    if input_cmd != []:
64 64
        try: load()
65
        except sql.EncodingException, e:
66
            exc.print_ex(e, plain=True)
67
            assert e.name == 'UTF8'
68
            
69
            db.set_encoding('LATIN1')
70
            load() # try again with new encoding
65 71
        except sql.DatabaseErrors, e:
66 72
            if use_copy_from: # first try
67 73
                exc.print_ex(e, plain=True)

Also available in: Unified diff