chiark / gitweb /
Fix up so hold status report still works if no capacity limit
[ypp-sc-tools.db-live.git] / yarrg / yppedia-ocean-scraper
index a85403504aae52764a1a6d96f7202f6444c005ed..476c1cd9b381bb0d5d5ec1979cc4928bff9fa9f4 100755 (executable)
@@ -42,6 +42,23 @@ import re as regexp
 from optparse import OptionParser
 from BeautifulSoup import BeautifulSoup
 
+
+# For fuck's sake!
+import codecs
+import locale
+def fix_stdout():
+    sys.stdout = codecs.EncodedFile(sys.stdout, locale.getpreferredencoding())
+    def null_decode(input, errors='strict'):
+        return input, len(input)
+    sys.stdout.decode = null_decode
+# From
+#  http://ewx.livejournal.com/457086.html?thread=3016574
+#  http://ewx.livejournal.com/457086.html?thread=3016574
+# lightly modified.
+# See also Debian #415968.
+fix_stdout()
+
+
 ocean = None
 soup = None
 opts = None