summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tests: skip some more tests on macOSpygobject-3-26Christoph Reiter2018-02-062-0/+2
| | | | | | I haven't looked into why, but my hope is that this makes tests pass on travis-ci, so we have a starting point and can at least catch regression in an automated fashion.
* pygobject-object: fix memory corruption around list of closuresMikhail Fludkov2018-02-062-0/+55
| | | | | | | | | | | | | | https://gitlab.gnome.org/GNOME/pygobject/issues/158 The memory corruption occurs because of the race while accessing PyGObjectData->closures list. Protect PyGObjectData->closures by GIL in pygobject_unwatch_closure. Despite the fact that we don't call any Python API in the function. We use GIL to be sure that PyGObjectData->closures list stays intact while GC iterating the list inside pygobject_traverse. Otherwise we can segfault while trying to call 'visit' function on an object that was just freed in pygobject_unwatch_closure.
* overrides: Fix Gtk.Adjustment.__init__ overrides not setting "value" ↵Christoph Reiter2018-02-062-0/+8
| | | | | | | | | | | | | | | | sometimes. Fixes #151 Gtk.Adjustment allows passing positional arguments to __init__ which get translated to a dict for passing to GObject.Object.__init__. In case of the first argument "value", if "value" is passed before the upper and lower bound to Object.__init__ it will be set to 0 instead. In Python 2 this happened to work (at least on my machine) because "value" got placed after the bounds (in terms of iteration order) in the final dict value passed to Object.__init__. To work around this, set "value" again after __init__(). A similar work around already exists when "value" is passed as a kwarg.
* version bumpChristoph Reiter2017-10-271-1/+1
|
* release 3.26.13.26.1Christoph Reiter2017-10-271-0/+11
|
* pygobject-object: Fix Python GC collecting a ref cycle too earlyChristoph Reiter2017-10-262-3/+32
| | | | | | | | | | | | | | | | | PyGObject traverses its closures in tp_traverse, but the lifetime of the closures is tied to the lifetime of the GObject and not the wrapper. This confuses the Python GC when it sees a ref cycle and tries to break it up with tp_clear. Since tp_clear will not invalidate the closure and only invalidate the Python wrapper the closure callback gets called with the now cleared/invalid object. Instead let the GC only check the Python objects referenced by the closure when tp_clear would actually free them and as a result break the cycle. This is only the case when the wrapped object would be freed by tp_clear which is when its reference count is at 1. Original patch by Gustavo Carneiro: https://bugzilla.gnome.org/show_bug.cgi?id=546802#c5 https://bugzilla.gnome.org/show_bug.cgi?id=731501
* Fix potential uninitialized memory access during GCDaniel Colascione2017-10-261-1/+1
| | | | | | | | | | | | | | | | | We use _PyGIDefaultArgPlaceholder as a sentinel value to represent default values during function argument list construction. Right now, it's a Python type object. We make it using PyObject_New, so most of its fields end up uninitialized. The object body being uninitialized wouldn't be a problem if the placeholder object were unreachable, but the object *can* be reached during GC by traversal through frame objects. Depending on the exact contents of the uninitialized memory, the GC can go on to cause other kinds of memory corruption through the process. IMHO, the easiest fix for this problem is to just make the placeholder a simpler data structure, like a list. https://bugzilla.gnome.org/show_bug.cgi?id=786872
* test: revert parts of the previous test as it's broken on 32 bit buildsChristoph Reiter2017-10-261-1/+0
| | | | | | | The int based flag type can't represent the flag value on 32 bit, some more work is needed there. Remove that check again for now. https://bugzilla.gnome.org/show_bug.cgi?id=786948
* flags: Add testcase for bug 786948Christoph Reiter2017-10-263-0/+45
| | | | | | | | Add a flags type which has a value with the highes bit set and fits in an int. While the C type is a signed int, the type is registered as flags, which GI interprets as unsigned. https://bugzilla.gnome.org/show_bug.cgi?id=786948
* fix potential overflow when marshalling flags from py interfacePhilippe Renon2017-10-261-4/+4
| | | | | | | | the overflow happens on windows platforms when an unsigned flags value overflows the capacity of a signed long on windows long is a 32-bit signed integer. fixes https://bugzilla.gnome.org/show_bug.cgi?id=786948
* to_py_array: Properly handle enum array itemsChristoph Reiter2017-10-264-0/+32
| | | | | | | It used the fallback path and copied pointers. Do the same thing we do for integer items instead. https://bugzilla.gnome.org/show_bug.cgi?id=788890
* closure: Fix unaligned and out-of-bounds accessJames Clarke2017-10-151-19/+21
| | | | | | | | | | | | | When the direction is FROM_PYTHON, a whole GIArgument was being loaded from the address given by the argument, but like any other case, this could point to different types, and so could run off the end of the pointed-to value, and, more importantly, be performing an unaligned access, causing it to crash with SIGBUS on sparc64 when running test_callback_scope_call_array_inout. Instead, reuse the existing code for the TO_PYTHON case to do the copying into arg_value based on the type. https://bugzilla.gnome.org/show_bug.cgi?id=788894
* build: Fix not installing .egg-info fileChristoph Reiter2017-10-141-0/+7
| | | | | | | | While removing the egg target in 49cc3643819dad0d065d I wrongfully removed that part as well. While the file extension has "egg" in it it has nothing to do with eggs.. https://bugzilla.gnome.org/show_bug.cgi?id=777719
* configure.ac: version bump to 3.26.1Christoph Reiter2017-10-121-1/+1
|
* release 3.26.03.26.0Christoph Reiter2017-09-121-0/+9
|
* configure.ac: pre-release version bump to 3.26.0Christoph Reiter2017-09-121-2/+2
|
* closure: silence a new compiler warningChristoph Reiter2017-08-251-2/+2
| | | | | gcc7 has started to warn for fallthrough in switch. Prevent this by duplicating the default case + break.
* tests: skip some failing test under Windows with Python 3.6Christoph Reiter2017-08-251-7/+17
| | | | | Python 3.6 has changed the default filesystem encoding on Windows from mbcs to utf-8. Some tests assume mbcs, so skip them for now.
* tests: pyflakes/pep8 fixesChristoph Reiter2017-08-222-4/+4
| | | | | Make Python 3 pyflakes work by adding Python 2 builtins through PYFLAKES_BUILTINS.
* tests: Fix cairo test with pycairo >= 1.13Christoph Reiter2017-06-091-1/+1
| | | | | All pycairo functions now return an enum value which type is an int subclass. Remove the overly strict check for the return value type.
* Make sure version information passed to require_version is a string.Benjamin Berg2017-04-262-0/+19
| | | | | | | This simply makes it easier for someone to find an error in cases where a floating point is passed by accident. https://bugzilla.gnome.org/show_bug.cgi?id=781582
* configure.ac: post-release version bump to 3.25.2Christoph Reiter2017-04-221-1/+1
|
* release 3.25.13.25.1Christoph Reiter2017-04-212-1/+60
|
* Bump pycairo requirement to 1.11.1Christoph Reiter2017-04-201-4/+3
| | | | | | | | | | | | | | | This requires pycairo from https://pycairo.readthedocs.io/en/latest/ (already updated/included in JHBuild) For more info on the upstream change see: https://lists.cairographics.org/archives/cairo/2017-April/027919.html https://mail.gnome.org/archives/desktop-devel-list/2017-April/msg00065.html This will enable cairo.Region support for all setups and Python versions as well as make moving to Python 3 easier for applications since all APIs provided under Python 2 are available there as well now. https://bugzilla.gnome.org/show_bug.cgi?id=707196
* configure.ac: Always disable -WerrorChristoph Reiter2017-04-201-1/+3
| | | | | | | Instead of disabling it for release builds do it always. While JHBuild uses --disable-Werror by default, gnome-continuous does not. See https://mail.gnome.org/archives/desktop-devel-list/2017-April/msg00009.html
* foreign-cairo: Enable cairo.Region support also on Python 2 if availableChristoph Reiter2017-04-091-2/+2
| | | | | | The next pycairo version might add support for cairo_region_t. This enables the converter functions also on Python 2 and makes sure that the test suite does not crash in case it does.
* configure.ac: remove unused PLATFORM variableChristoph Reiter2017-04-021-3/+0
| | | | This was added in 93e7d047e
* configure.ac: Remove unused PySignal_SetWakeupFd checkChristoph Reiter2017-04-021-12/+0
| | | | HAVE_PYSIGNAL_SETWAKEUPFD isn't used anywhere
* tests: remove python 2.5/3.2 compat codeChristoph Reiter2017-04-0210-111/+46
| | | | 2.7/3.3 support the u/b prefixes and both have callable()
* configure.ac: Require Python 3.3Christoph Reiter2017-04-021-1/+1
| | | | At the time of the next release nothing will support 3.2 anymore.
* tests: Make test suite run with GTK+ 4Christoph Reiter2017-04-026-27/+98
| | | | | | | Skip various tests which test things that are no longer available with gtk4. Does not remove any deprecated overrides. Disable gtk4 support in pygtkcompat. The porting path over gtk3 should be enough.
* tests: always call require_version; add TEST_GTK_VERSION env varChristoph Reiter2017-04-027-30/+34
| | | | | | | | Set the versions in runtests.py instead of repeating it in every test module. Add a new TEST_GTK_VERSION env var which defaults to "3.0". Allows to run tests with gtk4 using "make check TEST_GTK_VERSION=4.0"
* tests: Fix make check.valgrindChristoph Reiter2017-04-025-484/+14
| | | | | | | | | | | | Got broken when we changed to use dbus-run-session. Move valgrind related env vars before the dbus launcher helper. This also tries to improve the lookup of the suppression file. Instead of relying on the basename of the python binary use the python major version to select one of two suppression files in the repo. Add PYTHONMALLOC=malloc when running under valgrind, which makes Python use malloc instead of its own allocator. Only works with Python 3.6+.
* tests: Don't skip Regress tests when cairo is missingChristoph Reiter2017-04-027-76/+18
| | | | | | | | Since https://git.gnome.org/browse/pygobject/commit/?id=a731db5908b79b97277be4f5138b46010c2dd616 we build libregress even if cairo is missing. Instead of skipping regress tests when cairo is missing only skip cairo relate tests now.
* tests: fix invalid regex escapingChristoph Reiter2017-04-022-14/+14
| | | | | Python 3.6 got stricter here and raises warnings/errors for invalid escape sequences.
* tests: avoid mapping a GtkWindowChristoph Reiter2017-04-011-1/+2
| | | | | | This let to a window being shown when running the test suite. https://bugzilla.gnome.org/show_bug.cgi?id=780812
* tests: silence some glib deprecation warningsChristoph Reiter2017-04-012-4/+9
| | | | | | | These functions were deprecated in the last few cycles. This hides the warnings when running the test suite. https://bugzilla.gnome.org/show_bug.cgi?id=780812
* tests: avoid deprecation warnings for assertRegexpMatches/assertRaisesRegexpChristoph Reiter2017-04-011-0/+5
| | | | | | | Replace them with the renamed variants. We can't switch because there is no non-deprecated variant available under both Python 2 and 3. https://bugzilla.gnome.org/show_bug.cgi?id=780812
* pygi-source: clear exceptions in finalize handlerChristoph Reiter2017-04-011-0/+2
| | | | | | | | | This was executed in the context of Source.__del__ and while Python ignores errors there it started to warn with Python 3. This fixes the warnings visible when running test_source under Python 3. https://bugzilla.gnome.org/show_bug.cgi?id=780812
* Fix pep8 errorsChristoph Reiter2017-04-011-1/+1
|
* Remove gi._gi._gobject and gi._gobject modulesChristoph Reiter2017-04-0120-241/+199
| | | | | | | | | | Expose everything from _gi._gobject in _gi instead. This does not move any code around, just removes the module. Also removes the gi._gobject package and replaces it with a small dummy module in gi.__init__.py https://bugzilla.gnome.org/show_bug.cgi?id=735206
* Remove gi._gi._glib moduleChristoph Reiter2017-04-018-93/+39
| | | | | | | Move the code into gi._gi (gimodule) The module was a leftover from https://bugzilla.gnome.org/show_bug.cgi?id=712197 https://bugzilla.gnome.org/show_bug.cgi?id=735206
* GValue: add overflow checking for py -> gint; forward marshaling exceptionsChristoph Reiter2017-04-013-4/+17
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=769789
* pygobject_lookup_class: clear exceptions between calls and don't return with ↵Christoph Reiter2017-04-011-1/+6
| | | | | | one set https://bugzilla.gnome.org/show_bug.cgi?id=773394
* Avoid some new deprecation warningsChristoph Reiter2017-04-011-1/+5
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=780768
* Raise RuntimeError in case an uninitilialized GObject.Object is marshaledChristoph Reiter2017-03-312-0/+12
| | | | | | | One common case where this can happen is when subclassing a GObject.Object without chaining up __init__ and then calling a method. https://bugzilla.gnome.org/show_bug.cgi?id=730908
* closure: support unichar argsChristoph Reiter2017-03-302-0/+17
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=759276
* Add support for bytes and non-utf-8 file names.Christoph Reiter2017-03-307-41/+320
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Py2+Unix: Convert unicode to bytes using the fsencoding. Pass bytes as is. Returns path as bytes as is. Py2+Windows: Convert unicode to wtf-8. Pass bytes as is. Returns path as bytes as is. Py3+Unix: Convert str using os.fsencode so that the surrogateescape handler can restore the real path if the source was a Python API such as os.listdir sys.argv etc. Pass bytes as is. Return str decoded using os.fsdecode so that it can be passed to Python API such as open, os.listdir etc. Py3+Windows: Convert str to wtf-8. Decode bytes using the fsencoding first. Returns str + surrogates. This change makes anyting taking filenames on Python 3 behave the same as Python functions like listdir() or open(). Compared to Python 3 builtin functions which return the same type that was passed in we always return str. One remaining problem is that glib assumes that Windows paths are utf-16, while they are just 16bit arrays and as a result utf-8 is not enough to represent all possible paths. We use wtf-8 here instead (utf-8 with lone surrogates), which allows us to convert all paths, but glib functions accessing the fs will fail with them. PyUnicode_EncodeFSDefault was added in CPython 3.2 so bump the requirement. https://bugzilla.gnome.org/show_bug.cgi?id=746564
* test_gi: use correct min/max constants for gsize/gssizeChristoph Reiter2017-03-291-3/+3
| | | | | | This made these tests on 64bit Windows fail because sizeof(gsize) != sizeof(glong) https://bugzilla.gnome.org/show_bug.cgi?id=780591
* Don't use long format string for formatting pointersChristoph Reiter2017-03-291-2/+3
| | | | | | long is too small on 64bit Windows https://bugzilla.gnome.org/show_bug.cgi?id=780591