summaryrefslogtreecommitdiff
path: root/_dbus_bindings
Commit message (Collapse)AuthorAgeFilesLines
* fd.o #40817: validate UTF-8 according to the same rules as libdbusdbus-python-1.1.1Simon McVittie2012-06-251-29/+73
|
* Py3: correctly guess the signature of ObjectPath(...) and Signature(...)Simon McVittie2012-06-051-2/+12
| | | | | | | | | | | | Under Python 2, ObjectPath and Signature are subtypes of str (= bytes), and the existing type-guessing worked. The type-guessing code assumed that all unicode objects were just strings, but that assumption became false in the Python 3 port: ObjectPath and Signature are still subtypes of str, but str now means unicode, not bytes. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=50740
* Fix ref leak in dbus_py_variant_level_setSimon McVittie2012-03-121-0/+2
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=47108 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Use DBusBasicValue instead of reinventing it, if dbus is new enoughSimon McVittie2012-02-244-66/+99
| | | | | If we don't find it, continue to reinvent it, but move the reinvention to an internal header so it's at least the same in both files that want it.
* Add INTORLONG_CHECK macro so we don't have to conditionalize PyInt_CheckSimon McVittie2012-01-115-21/+11
|
* Use native 'int' (whatever that means) for variant_level etc.Simon McVittie2012-01-116-11/+17
| | | | | This reverts the Python 2 API to be in terms of PyInt, leaving the Python 3 API in terms of PyLong (which is called 'int' in Python code).
* Do not allow Byte(unicode(x)) (i.e. Byte(str(x)) in Python 3)Simon McVittie2012-01-111-14/+0
| | | | | Unicode strings aren't bytestrings, so there's no obvious meaning for the byte value of a Unicode string of length 1.
* Use better names for the superclasses of Byte and ByteArraySimon McVittie2012-01-111-9/+9
| | | | | | | | Strictly speaking, DBUS_FOO is libdbus' namespace, not ours. Use DBUS_PY_FOO. DBUS_BYTES_BASE was misleading: it's the base class for a single byte, so call it DBUS_PY_BYTE_BASE.
* Consistently use the str type for identifier-like (ASCII) stringsSimon McVittie2012-01-115-20/+12
| | | | | | | | | | | | | | | | | Porting to Python 3 left these methods returning unicode, which is arguably an API break in Python 2: * Message.get_member * Message.get_path_decomposed (array of unicode) * Message.get_sender * Message.get_destination * Message.get_interface * Message.get_error_name * Server.get_address * Server.get_id Instead, make them return whatever the natural str type is (bytes in Python 2, unicode in Python 3).
* DBusPythonString base class: use "native str" as base class instead of ↵Simon McVittie2012-01-112-11/+7
| | | | reinventing it
* SignalMessage.__repr__: include the destination and abbreviate "interface" ↵Simon McVittie2012-01-111-2/+5
| | | | | | more conventionally Yes, signals can have a destination. The default is to broadcast.
* Consistency; clean-up.Barry Warsaw2011-12-152-8/+8
|
* - Added back the missing PY3PORT.rst file, with updates.Barry Warsaw2011-12-151-20/+6
| | | | | | | - Disallow appending unicode objects with 'y' (bytes) signatures. This now requires either a bytes object or an integer. Update the tests to reflect - this change. - Fix broken __all__ in Python 3.
* This is the big one; it adds Python 3 support.Barry Warsaw2011-12-1519-191/+808
|
* First round of PyInt -> PyLong changes. These are only compatible with PythonBarry Warsaw2011-12-1413-73/+162
| | | | | | | 2, since there are still some unconditional PyInt calls, which are not valid in Python 3. However, it lays the framework for conditionalizing on Python 3 and using only PyLong in that case. Where it doesn't matter, PyLong is used unconditionally.
* Add error checking to dbus_py_variant_level_get() and call sites.Barry Warsaw2011-12-143-3/+27
|
* In preparation for Python 3 support, use the Python 2 PyBytes aliases for theBarry Warsaw2011-12-1412-115/+129
| | | | | PyString API. This makes the code compilable in Python 2.x (x >= 6) and Python 3.
* In preparation for Python 3 support, all reprs now return unicodes, which isBarry Warsaw2011-12-145-67/+92
| | | | | legal in Python 2 also. Use fancy REPR macro and the %V format code for cross-Python compatibility.
* Fix an inconsequential typo.Barry Warsaw2011-12-131-1/+1
|
* For pendantic correctness, and future Python 3 compatibility, explicitlyBarry Warsaw2011-12-132-0/+2
| | | | initialize the weaklist slots.
* Don't leak the fast_seq object.Barry Warsaw2011-12-131-1/+4
|
* - Add a few missing Py_TYPE() changes for Python 3 compatibility.Barry Warsaw2011-12-133-6/+6
| | | | - De-tabbify a few instances that "make check" complains about.
* Additional PyObject_HEAD_INIT -> PyVarObject_HEAD_INIT changes in preparationBarry Warsaw2011-12-136-26/+13
| | | | for Python 3 support.
* Use PyVarObject_HEAD_INIT to initialize typesBarry Warsaw2011-12-139-42/+21
| | | | | | Part of a patch for Python 3 compatibility. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Adjust debug messagesBarry Warsaw2011-12-131-3/+3
| | | | | | Part of a patch for Python 3 compatibility. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Use Py_TYPE() rather than thing->ob_type, for Python 3 portabilitySimon McVittie2011-12-1313-25/+25
| | | | | | Based on part of a patch from Barry Warsaw. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* _message_iter_get_pyobject: if UTF-8 from libdbus is invalid, don't crashSimon McVittie2011-12-131-3/+7
| | | | | | Based on part of a patch from Barry Warsaw. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Don't leak UTF-8 string if serializing a unicode object fails with OOMBarry Warsaw2011-12-131-0/+1
| | | | Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Remove dbus_py_tp_richcompare_by_pointer, dbus_py_tp_hash_by_pointerSimon McVittie2011-12-132-27/+0
| | | | | | These turn out not to be used for anything. Spotted by Barry Warsaw. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Remove support for Python < 2.5Simon McVittie2011-11-152-17/+0
|
* Bump dbus dependency to 1.4 so we can make decent error handling mandatorySimon McVittie2011-11-151-4/+0
|
* remove stray declaration of dbus_py_unixfd_range_checkSimon McVittie2011-05-181-1/+0
|
* Don't try to export DBUS_TYPE_UNIX_FD constant if not definedSimon McVittie2011-05-181-0/+2
|
* unixfd: improve documentationSimon McVittie2011-05-181-18/+18
|
* _message_iter_get_pyobject: fix whitespaceSimon McVittie2011-05-181-1/+1
|
* UnixFd: don't close file descriptors passed to the constructor as an intSimon McVittie2011-05-182-11/+11
| | | | | | | | Elvis agreed that this shouldn't differ from our handling of objects with a fileno(). This means that _message_iter_get_pyobject does need to close the fd itself, so do that.
* unixfd: coding styleSimon McVittie2011-05-181-9/+9
|
* Added Unix Fd support to dbus-pythonElvis Pfützenreuter2011-05-188-0/+283
|
* adjust Scott's patch to force boolean to be 0 or 1, and for coding styleSimon McVittie2011-05-171-2/+4
|
* Wrap dbus_connection_set_allow_anonymous()Scott Tsai2011-05-171-0/+20
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=34342 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* DBusPyException_ConsumeError: check whether the constructor failedSimon McVittie2010-12-021-0/+5
|
* fd.o #23831: make sure to ref types passed to PyModule_AddObjectSimon McVittie2010-12-0213-0/+25
| | | | | | | This avoids these static types wrongly being deallocated. Python implements static types as having one initial reference, which is never meant to be released, but if you get your refcounting wrong they'll be "deallocated" (causing a crash) during Py_Finalize.
* Use Py_CLEAR for greater robustnessSimon McVittie2010-12-0217-211/+200
|
* dbus_py_Message_append: avoid looking beyond the valid part of a signatureSimon McVittie2010-12-021-14/+22
| | | | | Similar reasoning: we don't even want to look where the iterator is pointing if the last call to dbus_signature_iter_next indicated "no more".
* _message_iter_append_multi: bail out safely if a struct isn't filledSimon McVittie2010-12-021-0/+9
| | | | | | In newer versions of libdbus, calling dbus_signature_iter_get_current_type when the iterator is pointing at the ')' of a struct trips an assertion failure, rather than just returning INVALID.
* Use dbus_message_iter_abandon_container to bail out, if supportedSimon McVittie2010-12-021-2/+20
| | | | | This avoids (potentially fatal) warnings, with newer libdbus; it'll only work if we were compiled against libdbus >= 1.3.0.
* _message_iter_append_multi: assert that mode is what we expectSimon McVittie2010-12-021-0/+5
|
* fd.o #21831: deserialize empty ByteArray objects correctlySimon McVittie2010-11-231-0/+6
| | | | | | For some reason libdbus gives us NULL instead of a pointer to a zero-length object (i.e. any random place in the message would do), which Py_BuildValue doesn't interpret the way we'd want it to.
* Fix compilation in 64-bit architectureElvis Pfützenreuter2010-10-181-1/+1
|
* Fix signature and return value of Connection_tp_init (oops)Simon McVittie2010-02-181-1/+3
|