Imported Upstream version 3.28.2 upstream/3.28.2
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 30 Oct 2018 01:30:19 +0000 (10:30 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 30 Oct 2018 01:30:19 +0000 (10:30 +0900)
18 files changed:
ChangeLog
NEWS
PKG-INFO
configure
configure.ac
gi/overrides/Gtk.py
gi/pygi-resulttuple.c
gi/pygi-value.c
gi/pyglib-python-compat.h
gi/pygobject-object.c
m4/ax_compiler_flags_cflags.m4
m4/ax_compiler_flags_ldflags.m4
setup.py
tests/Makefile.am
tests/Makefile.in
tests/test_overrides_gtk.py
tests/test_properties.py
tests/test_resulttuple.py

index 40ddc5a..a9b6b2b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,111 @@
+commit 3ba1f36ebd63ce4477fab1c0d1c9d7fc817f19a8
+Author: Christoph Reiter <reiter.christoph@gmail.com>
+Date:   Tue Mar 27 22:48:17 2018 +0200
+
+    release
+
+ NEWS | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+commit 8eb973ec4cafa6bbedb47e8d12bd02e6ed318273
+Author: Christoph Reiter <reiter.christoph@gmail.com>
+Date:   Sun Mar 25 19:12:54 2018 +0200
+
+    resulttuple: fix a wrong decref
+
+    We don't get ownership here so don't unref.
+    Thist function is only used in the test suite.
+
+ gi/pygi-resulttuple.c     | 2 --
+ tests/test_resulttuple.py | 6 ++++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+commit 1c962cb74cd99e0169abed45cf813550574a2a80
+Author: Christoph Reiter <reiter.christoph@gmail.com>
+Date:   Fri Mar 23 07:23:21 2018 +0100
+
+    autotools: define PY_SSIZE_T_CLEAN for the test extension
+
+ tests/Makefile.am | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+commit 1b072bb45b07bbb461bf9c8318a81a26e0d65a18
+Author: Christoph Reiter <reiter.christoph@gmail.com>
+Date:   Fri Mar 23 07:07:26 2018 +0100
+
+    setup.py: always define PY_SSIZE_T_CLEAN. Fixes #185
+
+ gi/pyglib-python-compat.h | 6 ++++++
+ setup.py                  | 5 +++--
+ 2 files changed, 9 insertions(+), 2 deletions(-)
+
+commit 997f6d95f3a1d8ce8376eb10e3f2d76d3b5e29d3
+Author: Christoph Reiter <reiter.christoph@gmail.com>
+Date:   Mon Mar 19 13:52:21 2018 +0100
+
+    properties: fix a crash when setting a str value containing
+    surrogates. Fixes #169
+
+    In Python 3 decoding unicode fails if it contains surrogates. Handle
+    that case.
+    This ususally happens with filenames where undecodable bytes get
+    converted to surrogates.
+
+ gi/pygi-value.c          |  4 ++++
+ gi/pygobject-object.c    |  4 ++--
+ tests/test_properties.py | 12 +++++++++++-
+ 3 files changed, 17 insertions(+), 3 deletions(-)
+
+commit c9cfde92d7a1eb558c66dc9e8e1959816fcbf0cc
+Author: Christoph Reiter <reiter.christoph@gmail.com>
+Date:   Sun Mar 18 07:33:19 2018 +0100
+
+    gtk overrides: Fix return type Gtk.TreePath with depth == 0. Fixes
+    #143
+
+    compare() also errors out with depth == 0, but str() shouldn't fail
+    as it's important for debugging.
+
+ gi/overrides/Gtk.py         | 2 +-
+ tests/test_overrides_gtk.py | 4 ++++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+commit c6d57734cf97b7eb7b11b21a9096d70dd1465865
+Author: Christoph Reiter <reiter.christoph@gmail.com>
+Date:   Sun Mar 18 21:57:07 2018 +0100
+
+    setup.py: build the test extension in a separate build dir. Fixes #181
+
+    The install command just copies the whole build tree as is when
+    installing
+    which installs the test extension when tests are build before install.
+
+    To avoid that set the build base of the extension to a a subdirectory
+    of the build base of the main build base.
+
+ setup.py | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+commit 923bef11d037e82ae0d91cb495a09d09ab93e3ca
+Author: Christoph Reiter <reiter.christoph@gmail.com>
+Date:   Sun Mar 18 22:28:34 2018 +0100
+
+    setup.py: forward force flag to the test extension build
+
+    backport from master
+
+ setup.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+commit 43758746432d5cd59409cd54eb242c8799e249c3
+Author: Christoph Reiter <reiter.christoph@gmail.com>
+Date:   Sat Mar 17 19:09:19 2018 +0100
+
+    version bump
+
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
 commit ca6918747214484a429c039caed02dd858c307fe
 Author: Christoph Reiter <reiter.christoph@gmail.com>
 Date:   Sat Mar 17 18:46:05 2018 +0100
diff --git a/NEWS b/NEWS
index 9ae0c32..f70ad81 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,14 @@
+3.28.2 - 2018-03-27
+-------------------
+
+* setup.py: Don't install the test C extension when it's built. :issue:`181`
+* setup.py: Always define PY_SSIZE_T_CLEAN. :issue:`185`
+* Fix __str__ return type of Gtk.TreePath with depth == 0. :issue:`143`
+* Fix a crash when setting a str property with a value containing surrogates.
+  :issue:`169`
+* tests: Fix a potential crash during tests
+
+
 3.28.1 - 2018-03-17
 -------------------
 
index 64adf04..646eca3 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: PyGObject
-Version: 3.28.1
+Version: 3.28.2
 Summary: Python bindings for GObject Introspection
 Home-page: https://pygobject.readthedocs.io
 Author: James Henstridge
index 3731605..0ab9c13 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for pygobject 3.28.1.
+# Generated by GNU Autoconf 2.69 for pygobject 3.28.2.
 #
 # Report bugs to <http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject>.
 #
@@ -591,8 +591,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='pygobject'
 PACKAGE_TARNAME='pygobject'
-PACKAGE_VERSION='3.28.1'
-PACKAGE_STRING='pygobject 3.28.1'
+PACKAGE_VERSION='3.28.2'
+PACKAGE_STRING='pygobject 3.28.2'
 PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=pygobject'
 PACKAGE_URL='https://wiki.gnome.org/Projects/PyGObject/'
 
@@ -1418,7 +1418,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures pygobject 3.28.1 to adapt to many kinds of systems.
+\`configure' configures pygobject 3.28.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1489,7 +1489,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of pygobject 3.28.1:";;
+     short | recursive ) echo "Configuration of pygobject 3.28.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1634,7 +1634,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-pygobject configure 3.28.1
+pygobject configure 3.28.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1912,7 +1912,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by pygobject $as_me 3.28.1, which was
+It was created by pygobject $as_me 3.28.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2290,9 +2290,9 @@ $as_echo "#define PYGOBJECT_MINOR_VERSION 28" >>confdefs.h
 PYGOBJECT_MINOR_VERSION=28
 
 
-$as_echo "#define PYGOBJECT_MICRO_VERSION 1" >>confdefs.h
+$as_echo "#define PYGOBJECT_MICRO_VERSION 2" >>confdefs.h
 
-PYGOBJECT_MICRO_VERSION=1
+PYGOBJECT_MICRO_VERSION=2
 
 
 ac_config_headers="$ac_config_headers config.h"
@@ -2812,7 +2812,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='pygobject'
- VERSION='3.28.1'
+ VERSION='3.28.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14838,27 +14838,6 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-      #ifndef __cplusplus
-       #error "no C++"
-       #endif
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ax_compiler_cxx=yes;
-else
-  ax_compiler_cxx=no;
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
     # Always pass -Werror=unknown-warning-option to get Clang to fail on bad
     # flags, otherwise they are always appended to the warn_cflags variable, and
     # Clang warns on them for every compilation unit.
@@ -15029,84 +15008,7 @@ done
 
 
 
-for flag in              -Wall             -Wextra             -Wundef             -Wwrite-strings             -Wpointer-arith             -Wmissing-declarations             -Wredundant-decls             -Wno-unused-parameter             -Wno-missing-field-initializers             -Wformat=2             -Wcast-align             -Wformat-nonliteral             -Wformat-security             -Wsign-compare             -Wstrict-aliasing             -Wshadow             -Winline             -Wpacked             -Wmissing-format-attribute             -Wmissing-noreturn             -Winit-self             -Wredundant-decls             -Wmissing-include-dirs             -Wunused-but-set-variable             -Warray-bounds             -Wreturn-type             -Wswitch-enum             -Wswitch-default             -Wduplicated-cond             -Wduplicated-branches             -Wlogical-op             -Wrestrict             -Wnull-dereference             -Wdouble-promotion                                                                ; do
-  as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
-$as_echo_n "checking whether C compiler accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  ax_check_save_flags=$CFLAGS
-  CFLAGS="$CFLAGS $ax_compiler_flags_test $flag"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$as_CACHEVAR=yes"
-else
-  eval "$as_CACHEVAR=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  CFLAGS=$ax_check_save_flags
-fi
-eval ac_res=\$$as_CACHEVAR
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
-
-if ${WARN_CFLAGS+:} false; then :
-
-  case " $WARN_CFLAGS " in #(
-  *" $flag "*) :
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS already contains \$flag"; } >&5
-  (: WARN_CFLAGS already contains $flag) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } ;; #(
-  *) :
-
-     as_fn_append WARN_CFLAGS " $flag"
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5
-  (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-     ;;
-esac
-
-else
-
-  WARN_CFLAGS=$flag
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: : WARN_CFLAGS=\"\$WARN_CFLAGS\""; } >&5
-  (: WARN_CFLAGS="$WARN_CFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-
-fi
-
-else
-  :
-fi
-
-done
-
-        if test "$ax_compiler_cxx" = "no" ; then
-            # C-only flags. Warn in C++
-
-
-
-
-for flag in              -Wnested-externs             -Wmissing-prototypes             -Wstrict-prototypes             -Wdeclaration-after-statement             -Wimplicit-function-declaration             -Wold-style-definition             -Wjump-misses-init             ; do
+for flag in              -Wall             -Wextra             -Wundef             -Wnested-externs             -Wwrite-strings             -Wpointer-arith             -Wmissing-declarations             -Wmissing-prototypes             -Wstrict-prototypes             -Wredundant-decls             -Wno-unused-parameter             -Wno-missing-field-initializers             -Wdeclaration-after-statement             -Wformat=2             -Wold-style-definition             -Wcast-align             -Wformat-nonliteral             -Wformat-security             -Wsign-compare             -Wstrict-aliasing             -Wshadow             -Winline             -Wpacked             -Wmissing-format-attribute             -Wmissing-noreturn             -Winit-self             -Wredundant-decls             -Wmissing-include-dirs             -Wunused-but-set-variable             -Warray-bounds             -Wimplicit-function-declaration             -Wreturn-type             -Wswitch-enum             -Wswitch-default                                                                ; do
   as_CACHEVAR=`$as_echo "ax_cv_check_cflags_$ax_compiler_flags_test_$flag" | $as_tr_sh`
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $flag" >&5
 $as_echo_n "checking whether C compiler accepts $flag... " >&6; }
@@ -15177,7 +15079,6 @@ fi
 
 done
 
-        fi
 
 fi
     if test "$ax_enable_compile_warnings" = "error"; then :
@@ -15458,461 +15359,7 @@ else
 fi
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--as-needed" >&5
-$as_echo_n "checking whether the linker accepts -Wl,--as-needed... " >&6; }
-if ${ax_cv_check_ldflags___Wl___as_needed+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  ax_check_save_flags=$LDFLAGS
-  LDFLAGS="$LDFLAGS  -Wl,--as-needed"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ax_cv_check_ldflags___Wl___as_needed=yes
-else
-  ax_cv_check_ldflags___Wl___as_needed=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$ax_check_save_flags
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___as_needed" >&5
-$as_echo "$ax_cv_check_ldflags___Wl___as_needed" >&6; }
-if test "x$ax_cv_check_ldflags___Wl___as_needed" = xyes; then :
-
-
-
-
-
-for flag in -Wl,--as-needed; do
-  as_CACHEVAR=`$as_echo "ax_cv_check_ldflags_$ax_compiler_flags_test_$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5
-$as_echo_n "checking whether the linker accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  ax_check_save_flags=$LDFLAGS
-  LDFLAGS="$LDFLAGS $ax_compiler_flags_test $flag"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_CACHEVAR=yes"
-else
-  eval "$as_CACHEVAR=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$ax_check_save_flags
-fi
-eval ac_res=\$$as_CACHEVAR
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
-
-if ${AM_LDFLAGS+:} false; then :
-
-  case " $AM_LDFLAGS " in #(
-  *" $flag "*) :
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5
-  (: AM_LDFLAGS already contains $flag) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } ;; #(
-  *) :
-
-     as_fn_append AM_LDFLAGS " $flag"
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
-  (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-     ;;
-esac
-
-else
-
-  AM_LDFLAGS=$flag
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
-  (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-
-fi
-
-else
-  :
-fi
-
-done
-
-
-else
-  :
-fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,relro" >&5
-$as_echo_n "checking whether the linker accepts -Wl,-z,relro... " >&6; }
-if ${ax_cv_check_ldflags___Wl__z_relro+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  ax_check_save_flags=$LDFLAGS
-  LDFLAGS="$LDFLAGS  -Wl,-z,relro"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ax_cv_check_ldflags___Wl__z_relro=yes
-else
-  ax_cv_check_ldflags___Wl__z_relro=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$ax_check_save_flags
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_relro" >&5
-$as_echo "$ax_cv_check_ldflags___Wl__z_relro" >&6; }
-if test "x$ax_cv_check_ldflags___Wl__z_relro" = xyes; then :
-
-
-
-
-
-for flag in -Wl,-z,relro; do
-  as_CACHEVAR=`$as_echo "ax_cv_check_ldflags_$ax_compiler_flags_test_$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5
-$as_echo_n "checking whether the linker accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  ax_check_save_flags=$LDFLAGS
-  LDFLAGS="$LDFLAGS $ax_compiler_flags_test $flag"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_CACHEVAR=yes"
-else
-  eval "$as_CACHEVAR=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$ax_check_save_flags
-fi
-eval ac_res=\$$as_CACHEVAR
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
-
-if ${AM_LDFLAGS+:} false; then :
-
-  case " $AM_LDFLAGS " in #(
-  *" $flag "*) :
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5
-  (: AM_LDFLAGS already contains $flag) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } ;; #(
-  *) :
-
-     as_fn_append AM_LDFLAGS " $flag"
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
-  (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-     ;;
-esac
-
-else
-
-  AM_LDFLAGS=$flag
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
-  (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-
-fi
-
-else
-  :
-fi
-
-done
-
-
-else
-  :
-fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,now" >&5
-$as_echo_n "checking whether the linker accepts -Wl,-z,now... " >&6; }
-if ${ax_cv_check_ldflags___Wl__z_now+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  ax_check_save_flags=$LDFLAGS
-  LDFLAGS="$LDFLAGS  -Wl,-z,now"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ax_cv_check_ldflags___Wl__z_now=yes
-else
-  ax_cv_check_ldflags___Wl__z_now=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$ax_check_save_flags
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_now" >&5
-$as_echo "$ax_cv_check_ldflags___Wl__z_now" >&6; }
-if test "x$ax_cv_check_ldflags___Wl__z_now" = xyes; then :
-
-
-
-
-
-for flag in -Wl,-z,now; do
-  as_CACHEVAR=`$as_echo "ax_cv_check_ldflags_$ax_compiler_flags_test_$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5
-$as_echo_n "checking whether the linker accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  ax_check_save_flags=$LDFLAGS
-  LDFLAGS="$LDFLAGS $ax_compiler_flags_test $flag"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_CACHEVAR=yes"
-else
-  eval "$as_CACHEVAR=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$ax_check_save_flags
-fi
-eval ac_res=\$$as_CACHEVAR
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
-
-if ${AM_LDFLAGS+:} false; then :
-
-  case " $AM_LDFLAGS " in #(
-  *" $flag "*) :
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5
-  (: AM_LDFLAGS already contains $flag) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } ;; #(
-  *) :
-
-     as_fn_append AM_LDFLAGS " $flag"
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
-  (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-     ;;
-esac
-
-else
-
-  AM_LDFLAGS=$flag
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
-  (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-
-fi
-
-else
-  :
-fi
-
-done
-
-
-else
-  :
-fi
-
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,noexecstack" >&5
-$as_echo_n "checking whether the linker accepts -Wl,-z,noexecstack... " >&6; }
-if ${ax_cv_check_ldflags___Wl__z_noexecstack+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  ax_check_save_flags=$LDFLAGS
-  LDFLAGS="$LDFLAGS  -Wl,-z,noexecstack"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ax_cv_check_ldflags___Wl__z_noexecstack=yes
-else
-  ax_cv_check_ldflags___Wl__z_noexecstack=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$ax_check_save_flags
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_noexecstack" >&5
-$as_echo "$ax_cv_check_ldflags___Wl__z_noexecstack" >&6; }
-if test "x$ax_cv_check_ldflags___Wl__z_noexecstack" = xyes; then :
-
-
-
-
-
-for flag in -Wl,-z,noexecstack; do
-  as_CACHEVAR=`$as_echo "ax_cv_check_ldflags_$ax_compiler_flags_test_$flag" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts $flag" >&5
-$as_echo_n "checking whether the linker accepts $flag... " >&6; }
-if eval \${$as_CACHEVAR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-  ax_check_save_flags=$LDFLAGS
-  LDFLAGS="$LDFLAGS $ax_compiler_flags_test $flag"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  eval "$as_CACHEVAR=yes"
-else
-  eval "$as_CACHEVAR=no"
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$ax_check_save_flags
-fi
-eval ac_res=\$$as_CACHEVAR
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then :
-
-if ${AM_LDFLAGS+:} false; then :
-
-  case " $AM_LDFLAGS " in #(
-  *" $flag "*) :
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS already contains \$flag"; } >&5
-  (: AM_LDFLAGS already contains $flag) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } ;; #(
-  *) :
-
-     as_fn_append AM_LDFLAGS " $flag"
-     { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
-  (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-     ;;
-esac
-
-else
-
-  AM_LDFLAGS=$flag
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: : AM_LDFLAGS=\"\$AM_LDFLAGS\""; } >&5
-  (: AM_LDFLAGS="$AM_LDFLAGS") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-
-fi
-
-else
-  :
-fi
-
-done
-
-
-else
-  :
-fi
-
-    # textonly, retpolineplt not yet
-
-    # macOS and cygwin linker do not have --as-needed
+    # macOS linker does not have --as-needed
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--no-as-needed" >&5
 $as_echo_n "checking whether the linker accepts -Wl,--no-as-needed... " >&6; }
 if ${ax_cv_check_ldflags___Wl___no_as_needed+:} false; then :
@@ -17484,7 +16931,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by pygobject $as_me 3.28.1, which was
+This file was extended by pygobject $as_me 3.28.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -17551,7 +16998,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-pygobject config.status 3.28.1
+pygobject config.status 3.28.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
index b336c68..800b590 100644 (file)
@@ -18,7 +18,7 @@ m4_define(python3_min_ver, 3.4)
 dnl the pygobject version number
 m4_define(pygobject_major_version, 3)
 m4_define(pygobject_minor_version, 28)
-m4_define(pygobject_micro_version, 1)
+m4_define(pygobject_micro_version, 2)
 m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pygobject_micro_version)
 
 dnl versions of packages we require ...
index 3709244..8f6a174 100644 (file)
@@ -1193,7 +1193,7 @@ class TreePath(Gtk.TreePath):
         super(TreePath, self).__init__()
 
     def __str__(self):
-        return self.to_string()
+        return self.to_string() or ""
 
     def __lt__(self, other):
         return other is not None and self.compare(other) < 0
index 8ddfeae..d2d89a7 100644 (file)
@@ -149,13 +149,11 @@ resulttuple_new_type(PyObject *self, PyObject *args) {
         return NULL;
 
     if (!PyList_Check (tuple_names)) {
-        Py_DECREF (tuple_names);
         PyErr_SetString (PyExc_TypeError, "not a list");
         return NULL;
     }
 
     new_type = (PyObject *)pygi_resulttuple_new_type (tuple_names);
-    Py_DECREF (tuple_names);
     return new_type;
 }
 
index 87d397b..814bb02 100644 (file)
@@ -500,6 +500,10 @@ pyg_value_from_pyobject_with_error(GValue *value, PyObject *obj)
                 g_value_set_string(value, PyString_AsString(tmp_str));
 #else
                 tmp = PyUnicode_AsUTF8String(tmp_str);
+                if (tmp == NULL) {
+                    Py_DECREF (tmp_str);
+                    return -1;
+                }
                 g_value_set_string(value, PyBytes_AsString(tmp));
                 Py_DECREF(tmp);
 #endif
index b1f4b22..cf0ebb4 100644 (file)
 #ifndef __PYGLIB_PYTHON_COMPAT_H__
 #define __PYGLIB_PYTHON_COMPAT_H__
 
+#ifndef PY_SSIZE_T_CLEAN
+#error "PY_SSIZE_T_CLEAN not defined"
+#endif
+
+#include <Python.h>
+
 # define PYGLIB_CPointer_Check PyCapsule_CheckExact
 # define PYGLIB_CPointer_WrapPointer(ptr, typename) \
     PyCapsule_New(ptr, typename, NULL)
index 304b427..ff15492 100644 (file)
@@ -332,9 +332,9 @@ set_property_from_pspec(GObject *obj,
 
     g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE(pspec));
     if (pyg_param_gvalue_from_pyobject(&value, pvalue, pspec) < 0) {
-        PyObject *pvalue_str = PyObject_Str(pvalue);
+        PyObject *pvalue_str = PyObject_Repr(pvalue);
        PyErr_Format(PyExc_TypeError,
-                    "could not convert '%s' to type '%s' when setting property '%s.%s'",
+                    "could not convert %s to type '%s' when setting property '%s.%s'",
                     PYGLIB_PyUnicode_AsString(pvalue_str),
                     g_type_name(G_PARAM_SPEC_VALUE_TYPE(pspec)),
                     G_OBJECT_TYPE_NAME(obj),
index 44d2882..aeb16e3 100644 (file)
 # LICENSE
 #
 #   Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
-#   Copyright (c) 2017, 2018 Reini Urban <rurban@cpan.org>
 #
 #   Copying and distribution of this file, with or without modification, are
 #   permitted in any medium without royalty provided the copyright notice
 #   and this notice are preserved.  This file is offered as-is, without any
 #   warranty.
 
-#serial 16
+#serial 14
 
 AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
     AC_REQUIRE([AC_PROG_SED])
@@ -40,13 +39,6 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
 
     AC_LANG_PUSH([C])
 
-    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
-      [#ifndef __cplusplus
-       #error "no C++"
-       #endif]])],
-      [ax_compiler_cxx=yes;],
-      [ax_compiler_cxx=no;])
-
     # Always pass -Werror=unknown-warning-option to get Clang to fail on bad
     # flags, otherwise they are always appended to the warn_cflags variable, and
     # Clang warns on them for every compilation unit.
@@ -77,13 +69,18 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
             -Wall dnl
             -Wextra dnl
             -Wundef dnl
+            -Wnested-externs dnl
             -Wwrite-strings dnl
             -Wpointer-arith dnl
             -Wmissing-declarations dnl
+            -Wmissing-prototypes dnl
+            -Wstrict-prototypes dnl
             -Wredundant-decls dnl
             -Wno-unused-parameter dnl
             -Wno-missing-field-initializers dnl
+            -Wdeclaration-after-statement dnl
             -Wformat=2 dnl
+            -Wold-style-definition dnl
             -Wcast-align dnl
             -Wformat-nonliteral dnl
             -Wformat-security dnl
@@ -99,32 +96,15 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[
             -Wmissing-include-dirs dnl
             -Wunused-but-set-variable dnl
             -Warray-bounds dnl
+            -Wimplicit-function-declaration dnl
             -Wreturn-type dnl
             -Wswitch-enum dnl
             -Wswitch-default dnl
-            -Wduplicated-cond dnl
-            -Wduplicated-branches dnl
-            -Wlogical-op dnl
-            -Wrestrict dnl
-            -Wnull-dereference dnl
-            -Wdouble-promotion dnl
             $4 dnl
             $5 dnl
             $6 dnl
             $7 dnl
         ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
-        if test "$ax_compiler_cxx" = "no" ; then
-            # C-only flags. Warn in C++
-            AX_APPEND_COMPILE_FLAGS([ dnl
-            -Wnested-externs dnl
-            -Wmissing-prototypes dnl
-            -Wstrict-prototypes dnl
-            -Wdeclaration-after-statement dnl
-            -Wimplicit-function-declaration dnl
-            -Wold-style-definition dnl
-            -Wjump-misses-init dnl
-            ],ax_warn_cflags_variable,[$ax_compiler_flags_test])
-        fi
     ])
     AS_IF([test "$ax_enable_compile_warnings" = "error"],[
         # "error" flags; -Werror has to be appended unconditionally because
index 976d119..842e329 100644 (file)
 # LICENSE
 #
 #   Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
-#   Copyright (c) 2017, 2018 Reini Urban <rurban@cpan.org>
 #
 #   Copying and distribution of this file, with or without modification, are
 #   permitted in any medium without royalty provided the copyright notice
 #   and this notice are preserved.  This file is offered as-is, without any
 #   warranty.
 
-#serial 9
+#serial 8
 
 AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
     AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS])
@@ -49,25 +48,7 @@ AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[
         ax_compiler_flags_test=""
     ])
 
-    AX_CHECK_LINK_FLAG([-Wl,--as-needed], [
-        AX_APPEND_LINK_FLAGS([-Wl,--as-needed],
-          [AM_LDFLAGS],[$ax_compiler_flags_test])
-    ])
-    AX_CHECK_LINK_FLAG([-Wl,-z,relro], [
-        AX_APPEND_LINK_FLAGS([-Wl,-z,relro],
-          [AM_LDFLAGS],[$ax_compiler_flags_test])
-    ])
-    AX_CHECK_LINK_FLAG([-Wl,-z,now], [
-        AX_APPEND_LINK_FLAGS([-Wl,-z,now],
-          [AM_LDFLAGS],[$ax_compiler_flags_test])
-    ])
-    AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [
-        AX_APPEND_LINK_FLAGS([-Wl,-z,noexecstack],
-          [AM_LDFLAGS],[$ax_compiler_flags_test])
-    ])
-    # textonly, retpolineplt not yet
-
-    # macOS and cygwin linker do not have --as-needed
+    # macOS linker does not have --as-needed
     AX_CHECK_LINK_FLAG([-Wl,--no-as-needed], [
         ax_compiler_flags_as_needed_option="-Wl,--no-as-needed"
     ], [
index 101e915..df168bb 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -221,12 +221,16 @@ class build_tests(Command):
 
     def initialize_options(self):
         self.build_temp = None
+        self.build_base = None
         self.force = False
 
     def finalize_options(self):
         self.set_undefined_options(
             'build_ext',
             ('build_temp', 'build_temp'))
+        self.set_undefined_options(
+            'build',
+            ('build_base', 'build_base'))
 
     def _newer_group(self, sources, *targets):
         assert targets
@@ -428,14 +432,21 @@ class build_tests(Command):
                 os.path.join(tests_dir, "test-unknown.h"),
                 os.path.join(tests_dir, "test-floating.h"),
             ],
+            define_macros=[("PY_SSIZE_T_CLEAN", None)],
         )
         add_ext_pkg_config_dep(ext, compiler.compiler_type, "glib-2.0")
         add_ext_pkg_config_dep(ext, compiler.compiler_type, "gio-2.0")
         add_ext_pkg_config_dep(ext, compiler.compiler_type, "cairo")
 
         dist = Distribution({"ext_modules": [ext]})
+
+        build_cmd = dist.get_command_obj("build")
+        build_cmd.build_base = os.path.join(self.build_base, "pygobject_tests")
+        build_cmd.ensure_finalized()
+
         cmd = dist.get_command_obj("build_ext")
         cmd.inplace = True
+        cmd.force = self.force
         cmd.ensure_finalized()
         cmd.run()
 
@@ -772,14 +783,14 @@ def main():
         name='gi._gi',
         sources=sources,
         include_dirs=[script_dir, gi_dir],
-        define_macros=[("HAVE_CONFIG_H", None)],
+        define_macros=[("HAVE_CONFIG_H", None), ("PY_SSIZE_T_CLEAN", None)],
     )
 
     gi_cairo_ext = Extension(
         name='gi._gi_cairo',
         sources=cairo_sources,
         include_dirs=[script_dir, gi_dir],
-        define_macros=[("HAVE_CONFIG_H", None)],
+        define_macros=[("HAVE_CONFIG_H", None), ("PY_SSIZE_T_CLEAN", None)],
     )
 
     setup(
index f04610a..31371c0 100644 (file)
@@ -23,6 +23,10 @@ extension_ldflags = \
        -module \
        -shrext $(PYTHON_SO)
 
+extension_cppflags = \
+       $(PYTHON_INCLUDES) \
+       -DPY_SSIZE_T_CLEAN
+
 nodist_libgimarshallingtests_la_SOURCES = \
        $(GI_DATADIR)/tests/gimarshallingtests.c \
        $(GI_DATADIR)/tests/gimarshallingtests.h
@@ -84,8 +88,8 @@ CLEANFILES += Regress-1.0.gir Regress-1.0.typelib GIMarshallingTests-1.0.gir GIM
 
 extension_ltlibraries += testhelper.la
 
-testhelper_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(WARN_CFLAGS) -I$(top_srcdir)/gi $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
-testhelper_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
+testhelper_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(WARN_CFLAGS) -I$(top_srcdir)/gi $(extension_cppflags) $(GLIB_CFLAGS)
+testhelper_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(extension_cppflags)
 testhelper_la_LDFLAGS = $(WARN_LDFLAGS) $(extension_ldflags)
 testhelper_la_LIBADD = $(CODE_COVERAGE_LIBS) $(GLIB_LIBS) $(extension_libadd)
 
index 16f2ab7..7dc52d5 100644 (file)
@@ -418,6 +418,10 @@ extension_ldflags = \
        -module \
        -shrext $(PYTHON_SO)
 
+extension_cppflags = \
+       $(PYTHON_INCLUDES) \
+       -DPY_SSIZE_T_CLEAN
+
 nodist_libgimarshallingtests_la_SOURCES = \
        $(GI_DATADIR)/tests/gimarshallingtests.c \
        $(GI_DATADIR)/tests/gimarshallingtests.h
@@ -439,8 +443,8 @@ dist_libregress_la_SOURCES = $(srcdir)/regressextra.c $(srcdir)/regressextra.h
 @ENABLE_CAIRO_FALSE@libregress_la_LIBADD = $(GIO_LIBS) $(CAIRO_LIBS)
 @ENABLE_CAIRO_TRUE@libregress_la_LIBADD = $(GIO_LIBS) $(CAIRO_LIBS)
 libregress_la_LDFLAGS = $(common_ldflags)
-testhelper_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(WARN_CFLAGS) -I$(top_srcdir)/gi $(PYTHON_INCLUDES) $(GLIB_CFLAGS)
-testhelper_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS)
+testhelper_la_CFLAGS = $(CODE_COVERAGE_CFLAGS) $(WARN_CFLAGS) -I$(top_srcdir)/gi $(extension_cppflags) $(GLIB_CFLAGS)
+testhelper_la_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) $(extension_cppflags)
 testhelper_la_LDFLAGS = $(WARN_LDFLAGS) $(extension_ldflags)
 testhelper_la_LIBADD = $(CODE_COVERAGE_LIBS) $(GLIB_LIBS) $(extension_libadd)
 testhelper_la_SOURCES = \
index aa55564..7f29f17 100644 (file)
@@ -1393,6 +1393,10 @@ class TestTreeModel(unittest.TestCase):
         self.assertEqual(p1[2], 3)
         self.assertRaises(IndexError, p1.__getitem__, 3)
 
+    def test_tree_path_empty(self):
+        p1 = Gtk.TreePath.new()
+        assert str(p1) == ""
+
     def test_tree_model(self):
         tree_store = Gtk.TreeStore(int, str)
 
index 268ee93..622fdb2 100644 (file)
@@ -10,6 +10,8 @@ import types
 import unittest
 import tempfile
 
+import pytest
+
 from gi.repository import GObject
 from gi.repository.GObject import ParamFlags, GType, new
 from gi.repository.GObject import \
@@ -29,7 +31,7 @@ from gi.repository import GIMarshallingTests
 from gi.repository import Regress
 from gi import _propertyhelper as propertyhelper
 
-from .compathelper import _long
+from .compathelper import _long, PY3
 from .helper import capture_glib_warnings, capture_output
 
 
@@ -178,6 +180,14 @@ class TestPropertyObject(unittest.TestCase):
         obj.props.normal = unicode_utf8
         self.assertEqual(obj.props.normal, test_utf8)
 
+    def test_utf8_lone_surrogate(self):
+        obj = PropertyObject()
+        if PY3:
+            with pytest.raises(TypeError):
+                obj.set_property('construct', '\ud83d')
+        else:
+            obj.set_property('construct', '\ud83d')
+
     def test_int_to_str(self):
         obj = new(PropertyObject, construct_only=1)
         self.assertEqual(obj.props.construct_only, '1')
index 1a4aadf..4576495 100644 (file)
@@ -37,8 +37,10 @@ class TestResultTuple(unittest.TestCase):
         self.assertTrue(issubclass(ResultTuple, tuple))
 
     def test_create(self):
-        new = ResultTuple._new_type([None, "foo", None, "bar"])
-        self.assertTrue(issubclass(new, ResultTuple))
+        names = [None, "foo", None, "bar"]
+        for i in range(10):
+            new = ResultTuple._new_type(names)
+            self.assertTrue(issubclass(new, ResultTuple))
 
     def test_repr_dir(self):
         new = ResultTuple._new_type([None, "foo", None, "bar"])