Project

General

Profile

« Previous | Next » 

Revision 3610

csv2db: log(): sys.stderr.write(): Run strings.to_raw_str() on message to handle Unicode chars

View differences:

bin/csv2db
43 43
    # Connect to DB
44 44
    def log(msg, level=1):
45 45
        '''Higher level -> more verbose'''
46
        if level <= verbosity: sys.stderr.write(msg.rstrip('\n')+'\n')
46
        if level <= verbosity:
47
            sys.stderr.write(strings.to_raw_str(msg.rstrip('\n')+'\n'))
47 48
    db = sql.connect(db_config, log_debug=log)
48 49
    
49 50
    table = sql_gen.Table(table, schema)

Also available in: Unified diff