Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
This would actually work fine if the default encoding was UTF-8 or
Latin-1 or something.
|
|
[commit message amended -smcv]
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=55899
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
|
|
Based on a patch from Christoph Höger.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=51725
|
|
|
|
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
|
|
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48904
|
|
Some automated build systems (naming no Portage) have really long build
directories, which can cause dbus-python to hit the length limit for Unix
sockets' names.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46747
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
|
|
|
|
Unicode strings aren't bytestrings, so there's no obvious meaning for
the byte value of a Unicode string of length 1.
|
|
|
|
Changes include:
- DBusException.get_dbus_message(): In Python 3, the str of the exception will
already be a unicode, so don't try to decode it unless it's a bytes object
(a.k.a. 8-bit str in Python 2).
- gobject_service.py: Switch to pygi and rewrite the metaclass instantiation
code to be portable between Python 2 and Python 3.
- run-test.sh: echo a few more useful environment variables
- test-client.py:
- Globally replace deprecated assertEquals with assertEqual
- Globally replace deprecated assert_ with assertTrue
- Use bytes objects for both 'ay' signatured methods on the server
- AcceptUnicodeString will return a native unicode, i.e. a str in Python 3
and a unicode in Python 2. Python 3 has no `unicode` built-in.
- Reformat some long lines for debugging.
- test-service.py:
- Open the log file in 'a' mode for easier tailing.
- AcceptUnicodeString will return a native unicode, i.e. a str in Python 3
and a unicode in Python 2. Python 3 has no `unicode` built-in.
- reformat some long lines for debugging.
- Put module-scope code into a main() function and add a bunch of logger
output for better debugging. `session_bus` must still be global though.
Wrap main() in a bit try/except to log all top-level exceptions.
|
|
Fix another except syntax problem.
|
|
|
|
object paths in Python3, as per Simon's review comments.
|
|
- 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.
|
|
|
|
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.
|
|
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
|
|
|
|
|
|
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.
|
|
set() has been a built-in since 2.4, and we don't support older versions.
|
|
|
|
Specifically, DBusException and its subclasses no longer have the remote
traceback by default (although subclasses can turn it back on again
by setting include_traceback = True, and the various "programmer error"
subclasses of DBusException do have this set).
Hopefully this will stop people thinking it's a dbus-python or
telepathy-python bug when a D-Bus API like Telepathy deliberately raises an
error (and so dbus-python or telepathy-python is visible in the traceback).
|
|
By either appending to a list of callbacks, or subclassing and providing a
method, you can be notified when connections are added or removed.
Inspired by the DBusServer patch from Huang Peng.
|
|
|
|
|
|
This affects code with copyright statements from the following individuals:
* Anders Carlsson
* Colin Walters
* David Zeuthen
* Rob Taylor
and the following companies:
* Collabora Ltd. (represented by me)
* Red Hat Inc. (represented by Havoc Pennington)
|
|
|
|
Havoc's permission
(Message-ID: <815098350709271800k2505485dlef9414609d392b48@mail.gmail.com>)
|
|
|
|
removing all references to the LGPL as a result
|
|
This fixes incorrect Python path for docs and tests if doing an out-of-tree
build using an absolute path for $(srcdir), and is also less ugly.
|
|
|
|
|
|
object path (bugs.fd.o #11794)
|
|
already used seconds). Add regression tests
|
|
BusName ctor
|
|
In the process, simplify the signal decorator a bit - don't allow the signal
to be emitted from a subset of interfaces (removing connection_keyword),
deprecate path_keyword, disallow path_keyword on objects that support multiple
object paths, and add rel_path_keyword. This is an API removal since previous
patches, but is compatible with the last release.
|
|
Also allow them to be exported on more than one object path or even connection.
dbus.decorators: Allow connection_keyword on signals and methods, so we can
tell which connection to use for any follow-up actions.
|
|
|
|
|
|
This is equivalent to dbus_connection_list_registered() in libdbus.
|
|
This prevents a deadlock when a signal match that's tracking name owner
changes is removed, causing a match on NameOwnerChanged to be removed too.
(Debian bug#426412)
Also move more of the tree manipulation inside the lock, to be nice to
anyone attempting a port to implementations without a GIL (mainly IronPython),
and add a regression test for the above bug.
|
|
intermittent failures
|
|
Also add a simple unit test for it.
|
|
(Actually tested by connecting to the bus daemon, because I haven't implemented
a Python binding for DBusServer yet.)
|
|
GetNameOwner too
|
|
|