diff --git a/magneto/src/magneto/core/interfaces.py b/magneto/src/magneto/core/interfaces.py index 66c285e81..27c130e9b 100644 --- a/magneto/src/magneto/core/interfaces.py +++ b/magneto/src/magneto/core/interfaces.py @@ -22,7 +22,7 @@ from threading import Lock # Entropy imports from entropy.output import nocolor from entropy.client.interfaces import Client -from entropy.const import etpConst, const_debug_write +from entropy.const import etpConst, const_debug_write, const_is_python3 import entropy.tools from entropy.i18n import _, ngettext from entropy.misc import ParallelTask @@ -322,7 +322,10 @@ class MagnetoCore(MagnetoCoreUI): """ Convert dbus.String() to unicode object """ - return dbus_string.decode(etpConst['conf_encoding']) + if const_is_python3(): + return str(dbus_string) + else: + return dbus_string.decode(etpConst['conf_encoding']) def _updates_available_signal(self, update, update_atoms, remove, remove_atoms, diff --git a/rigo/RigoDaemon/app/RigoDaemon_app.py b/rigo/RigoDaemon/app/RigoDaemon_app.py index 384ba5fc3..54e07c53d 100755 --- a/rigo/RigoDaemon/app/RigoDaemon_app.py +++ b/rigo/RigoDaemon/app/RigoDaemon_app.py @@ -72,7 +72,7 @@ EntropyRepositoryCachePolicies.DEFAULT_CACHE_POLICY = _NONE_POL from entropy.const import etpConst, const_convert_to_rawstring, \ initconfig_entropy_constants, const_debug_write, dump_signal, \ - const_mkstemp + const_mkstemp, const_is_python3 from entropy.locks import EntropyResourcesLock, UpdatesNotificationResourceLock from entropy.exceptions import DependenciesNotFound, \ DependenciesCollision, DependenciesNotRemovable, SystemDatabaseError, \ @@ -1159,7 +1159,10 @@ class RigoDaemonService(dbus.service.Object): """ Convert dbus.String() to unicode object """ - return dbus_string.decode(etpConst['conf_encoding']) + if const_is_python3(): + return str(dbus_string) + else: + return dbus_string.decode(etpConst['conf_encoding']) def _execute_mainloop(self, function, *args, **kwargs): """