Revision 2883
Added by Aaron Marcuse-Kubitza over 12 years ago
map | ||
---|---|---|
120 | 120 |
first_line, nl, msg = msg.partition('\n') |
121 | 121 |
elif level > 1: msg = '['+str(level)+'] '+msg # include level in msg |
122 | 122 |
|
123 |
sys.stderr.write(msg.rstrip('\n')+'\n')
|
|
123 |
sys.stderr.write(strings.to_raw_str(msg.rstrip('\n')+'\n'))
|
|
124 | 124 |
if debug: log_debug = lambda msg, level=2: log(msg, level) |
125 | 125 |
else: log_debug = sql.log_debug_none |
126 | 126 |
|
Also available in: Unified diff
Wrap sys.stderr.write() calls in strings.to_raw_str() to avoid UnicodeEncodeErrors when stderr is to a file and the default encoding is ASCII