r50051 - in /desktop/unstable/pygobject/debian: changelog patches/04_Handle-nullable-filename-parameters.patch patches/series
biebl at users.alioth.debian.org
biebl at users.alioth.debian.org
Sat Sep 3 21:40:15 UTC 2016
Author: biebl
Date: Sat Sep 3 21:40:15 2016
New Revision: 50051
URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=50051
Log:
Handle nullable filename parameters. This fixes a test suite error in
test_spawn_async_with_pipes triggered by an annotation change in glib.
Added:
desktop/unstable/pygobject/debian/patches/04_Handle-nullable-filename-parameters.patch
Modified:
desktop/unstable/pygobject/debian/changelog
desktop/unstable/pygobject/debian/patches/series
Modified: desktop/unstable/pygobject/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/changelog?rev=50051&op=diff
==============================================================================
--- desktop/unstable/pygobject/debian/changelog [utf-8] (original)
+++ desktop/unstable/pygobject/debian/changelog [utf-8] Sat Sep 3 21:40:15 2016
@@ -6,6 +6,8 @@
[ Michael Biebl ]
* Use dbus-run-session instead of dbus-launch to run the tests.
(Closes: #836049)
+ * Handle nullable filename parameters. This fixes a test suite error in
+ test_spawn_async_with_pipes triggered by an annotation change in glib.
-- Michael Biebl <biebl at debian.org> Sat, 03 Sep 2016 15:50:04 +0200
Added: desktop/unstable/pygobject/debian/patches/04_Handle-nullable-filename-parameters.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/patches/04_Handle-nullable-filename-parameters.patch?rev=50051&op=file
==============================================================================
--- desktop/unstable/pygobject/debian/patches/04_Handle-nullable-filename-parameters.patch (added)
+++ desktop/unstable/pygobject/debian/patches/04_Handle-nullable-filename-parameters.patch [utf-8] Sat Sep 3 21:40:15 2016
@@ -0,0 +1,96 @@
+From 7ccc164b6da6d87c0a200ea50314d213470a1f18 Mon Sep 17 00:00:00 2001
+From: Christoph Reiter <creiter at src.gnome.org>
+Date: Sat, 3 Sep 2016 20:02:13 +0200
+Subject: [PATCH] Handle nullable filename parameters
+
+Make _pygi_marshal_from_py_filename handle None input
+values. This allows one to pass None to parameters
+annotated as nullable filenames.
+
+This fixes a test suite error in test_spawn_async_with_pipes
+triggered by an annotation change in glib.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=770821
+---
+ gi/pygi-basictype.c | 5 +++++
+ tests/gimarshallingtestsextra.c | 22 ++++++++++++++++++++++
+ tests/gimarshallingtestsextra.h | 3 +++
+ tests/test_gi.py | 4 ++++
+ 4 files changed, 34 insertions(+)
+
+diff --git a/gi/pygi-basictype.c b/gi/pygi-basictype.c
+index b6515c3..4a5e112 100644
+--- a/gi/pygi-basictype.c
++++ b/gi/pygi-basictype.c
+@@ -255,6 +255,11 @@ _pygi_marshal_from_py_filename (PyObject *py_arg,
+ GError *error = NULL;
+ PyObject *tmp = NULL;
+
++ if (py_arg == Py_None) {
++ arg->v_pointer = NULL;
++ return TRUE;
++ }
++
+ if (PyUnicode_Check (py_arg)) {
+ tmp = PyUnicode_AsUTF8String (py_arg);
+ if (!tmp)
+diff --git a/tests/gimarshallingtestsextra.c b/tests/gimarshallingtestsextra.c
+index 56b0113..85a9fba 100644
+--- a/tests/gimarshallingtestsextra.c
++++ b/tests/gimarshallingtestsextra.c
+@@ -68,3 +68,25 @@ gi_marshalling_tests_ghashtable_enum_none_return (void)
+
+ return hash_table;
+ }
++
++/**
++ * gi_marshalling_tests_filename_copy:
++ * @path_in: (type filename) (nullable)
++ *
++ * Returns: (type filename) (nullable)
++ */
++gchar *
++gi_marshalling_tests_filename_copy (gchar *path_in)
++{
++ return g_strdup (path_in);
++}
++
++/**
++ * gi_marshalling_tests_filename_exists:
++ * @path: (type filename)
++ */
++gboolean
++gi_marshalling_tests_filename_exists (gchar *path)
++{
++ return g_file_test (path, G_FILE_TEST_EXISTS);
++}
+diff --git a/tests/gimarshallingtestsextra.h b/tests/gimarshallingtestsextra.h
+index ae6be1b..51a65f2 100644
+--- a/tests/gimarshallingtestsextra.h
++++ b/tests/gimarshallingtestsextra.h
+@@ -33,4 +33,7 @@ void gi_marshalling_tests_compare_two_gerrors_in_gvalue (GValue *v, GValue *v1);
+ void gi_marshalling_tests_ghashtable_enum_none_in (GHashTable *hash_table);
+ GHashTable * gi_marshalling_tests_ghashtable_enum_none_return (void);
+
++gchar * gi_marshalling_tests_filename_copy (gchar *path_in);
++gboolean gi_marshalling_tests_filename_exists (gchar *path);
++
+ #endif /* EXTRA_TESTS */
+diff --git a/tests/test_gi.py b/tests/test_gi.py
+index d246a01..d0c72b6 100644
+--- a/tests/test_gi.py
++++ b/tests/test_gi.py
+@@ -710,6 +710,10 @@ class TestFilename(unittest.TestCase):
+ self.assertEqual(result, True)
+ self.assertEqual(contents, b'hello world!\n\x01\x02')
+
++ def test_filename_in_nullable(self):
++ self.assertTrue(GIMarshallingTests.filename_copy(None) is None)
++ self.assertRaises(TypeError, GIMarshallingTests.filename_exists, None)
++
+ def test_filename_out(self):
+ self.assertRaises(GLib.GError, GLib.Dir.make_tmp, 'test')
+
+--
+2.9.3
+
Modified: desktop/unstable/pygobject/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/unstable/pygobject/debian/patches/series?rev=50051&op=diff
==============================================================================
--- desktop/unstable/pygobject/debian/patches/series [utf-8] (original)
+++ desktop/unstable/pygobject/debian/patches/series [utf-8] Sat Sep 3 21:40:15 2016
@@ -1,3 +1,4 @@
01_cairo_region.patch
02_Fix-list-hashtable-enum-hash-conversion-on-64-bit-bi.patch
03_tests-use-dbus-run-session-instead-of-dbus-launch.patch
+04_Handle-nullable-filename-parameters.patch
More information about the pkg-gnome-commits
mailing list