Project

General

Profile

« Previous | Next » 

Revision 4492

Replaced repr() with strings.urepr() (or equivalent) everywhere needed, to avoid future UnicodeEncodeErrors

View differences:

sql_io.py
420 420
            
421 421
            sql.add_index(db, in_col, insert_in_table) # enable fast filtering
422 422
            if value != None and in_col not in not_null_cols:
423
                log_debug('Replacing invalid value '+strings.as_tt(repr(value))
424
                    +' with NULL in column '+strings.as_tt(in_col.to_str(db)))
423
                log_debug('Replacing invalid value '
424
                    +strings.as_tt(strings.urepr(value))+' with NULL in column '
425
                    +strings.as_tt(in_col.to_str(db)))
425 426
                sql.update(db, insert_in_table, [(in_col, None)],
426 427
                    sql_gen.ColValueCond(in_col, value))
427 428
            else:
428 429
                log_debug('Ignoring rows with '+strings.as_tt(in_col.to_str(db))
429
                    +' = '+strings.as_tt(repr(value)))
430
                    +' = '+strings.as_tt(strings.urepr(value)))
430 431
                sql.delete(db, insert_in_table,
431 432
                    sql_gen.ColValueCond(in_col, value))
432 433
                if value == None: not_null_cols.add(in_col)
......
501 502
        if limit_ref[0] == 0:
502 503
            if is_literals or default == None:
503 504
                default = sql_gen.remove_col_rename(default)
504
                log_debug('Returning default: '+strings.as_tt(repr(default)))
505
                log_debug('Returning default: '
506
                    +strings.as_tt(strings.urepr(default)))
505 507
                return default
506 508
            elif is_function: pass # empty pkeys table already created
507 509
            else:
......
649 651
    
650 652
    if limit_ref[0] == 0 or not is_function: # is_function doesn't leave holes
651 653
        log_debug('Setting pkeys of missing rows to '
652
            +strings.as_tt(repr(default)))
654
            +strings.as_tt(strings.urepr(default)))
653 655
        missing_rows_joins = [full_in_table, sql_gen.Join(into,
654 656
            {in_pkey: sql_gen.join_same_not_null}, sql_gen.filter_out)]
655 657
            # must use join_same_not_null or query will take forever

Also available in: Unified diff