[BACK]Return to patch-gobject_glib-mkenums.in CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / devel / glib2 / patches

File: [cvs.NetBSD.org] / pkgsrc / devel / glib2 / patches / patch-gobject_glib-mkenums.in (download)

Revision 1.4, Sun Apr 1 20:26:25 2018 UTC (2 years, 4 months ago) by joerg
Branch: MAIN
CVS Tags: pkgsrc-2019Q1-base, pkgsrc-2019Q1, pkgsrc-2018Q4-base, pkgsrc-2018Q4, pkgsrc-2018Q3-base, pkgsrc-2018Q3, pkgsrc-2018Q2-base, pkgsrc-2018Q2, pkgsrc-2018Q1-base, pkgsrc-2018Q1
Changes since 1.3: +15 -2 lines

Don't print characters that can't be converted to UTF-8. Chances are,
they won't make it to stdout as well and break the tool, especially with
Python 2.7. Bump revision of glib2-tools.

$NetBSD: patch-gobject_glib-mkenums.in,v 1.4 2018/04/01 20:26:25 joerg Exp $

- Revert 4395a897 Use env to run the Python-based tools
  https://bugzilla.gnome.org/show_bug.cgi?id=788527
- Do not print failing characters that might not be ASCII

--- gobject/glib-mkenums.in.orig	2018-01-08 20:00:49.000000000 +0000
+++ gobject/glib-mkenums.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env @PYTHON@
+#!@PYTHON@
 
 # If the code below looks horrible and unpythonic, do not panic.
 #
@@ -88,9 +88,8 @@ else:
 # https://bugzilla.gnome.org/show_bug.cgi?id=785113#c20
 def replace_and_warn(err):
     # 7 characters of context either side of the offending character
-    print_warning('UnicodeWarning: {} at {} ({})'.format(
-        err.reason, err.start,
-        err.object[err.start - 7:err.end + 7]))
+    print_warning('UnicodeWarning: {} at {}'.format(
+        err.reason, err.start))
     return ('?', err.end)
 
 codecs.register_error('replace_and_warn', replace_and_warn)