35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
|
From 2d364e50140d17cf455365df537e5976d5d480d2 Mon Sep 17 00:00:00 2001
|
||
|
From: Dominique Leuenberger <dimstar@opensuse.org>
|
||
|
Date: Sat, 2 Dec 2017 16:11:50 +0100
|
||
|
Subject: [PATCH] Use logging infrastructure for LogWarning
|
||
|
|
||
|
Using pure 'print' statements often fail if we have a message containing
|
||
|
UTF-8, but output on a terminal/pipe not supporting UTF-8.
|
||
|
|
||
|
Instead of trying to en/decode (and likely fail all the time) use logging.warning
|
||
|
|
||
|
This causes a slight change of the format, as the log is prefixed with WARNING:root
|
||
|
but that seems better than crashing
|
||
|
|
||
|
https://bugzilla.gnome.org/show_bug.cgi?id=791131
|
||
|
---
|
||
|
gtkdoc/common.py | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/gtkdoc/common.py b/gtkdoc/common.py
|
||
|
index ca82263..286f7f3 100644
|
||
|
--- a/gtkdoc/common.py
|
||
|
+++ b/gtkdoc/common.py
|
||
|
@@ -148,7 +148,7 @@ def LogWarning(filename, line, message):
|
||
|
filename = filename or "unknown"
|
||
|
|
||
|
# TODO: write to stderr
|
||
|
- print ("%s:%d: warning: %s" % (filename, line, message))
|
||
|
+ logging.warning ("%s:%d: warning: %s" % (filename, line, message))
|
||
|
|
||
|
|
||
|
def CreateValidSGMLID(xml_id):
|
||
|
--
|
||
|
2.15.0
|
||
|
|