Skip to content

Commit bbd6aef

Browse files
committed
python: use utf-8 encoding for gdb_write
Routine print operations end up getting encoding exceptions since the default encoding is ascii. Most systems are using utf-8 now so let's use that instead. This is a hack and we should be looking at the locale. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
1 parent bbfbfa1 commit bbd6aef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gdb/python/python.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,8 +1121,8 @@ gdbpy_write (PyObject *self, PyObject *args, PyObject *kw)
11211121
static char *keywords[] = {"text", "stream", NULL };
11221122
int stream_type = 0;
11231123

1124-
if (! PyArg_ParseTupleAndKeywords (args, kw, "s|i", keywords, &arg,
1125-
&stream_type))
1124+
if (! PyArg_ParseTupleAndKeywords (args, kw, "es|i", keywords, "utf-8",
1125+
&arg, &stream_type))
11261126
return NULL;
11271127

11281128
TRY

0 commit comments

Comments
 (0)