Package: nautilus-admin
Version: 1.1.9-3
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu impish ubuntu-patch

The bug has been initially reported on
https://bugs.launchpad.net/ubuntu/+source/nautilus-admin/+bug/1924573

'$ nautilus -q
Traceback (most recent call last):
  File "/usr/share/nautilus-python/extensions/nautilus-admin.py", line
25, in <module>
    from gettext import gettext, locale, bindtextdomain, textdomain
ImportError: cannot import name 'locale' from 'gettext'
(/usr/lib/python3.9/gettext.py)'

The attached patch fixes the issue and comes from
https://github.com/TomaszGasior/mushrooms-rpms/issues/41

Cbeers,

diff -Nru nautilus-admin-1.1.9/debian/changelog nautilus-admin-1.1.9/debian/changelog
--- nautilus-admin-1.1.9/debian/changelog	2019-11-04 21:11:13.000000000 +0100
+++ nautilus-admin-1.1.9/debian/changelog	2021-06-08 10:48:53.000000000 +0200
@@ -1,3 +1,11 @@
+nautilus-admin (1.1.9-3.1) unstable; urgency=medium
+
+  * debian/patches/new-python-compat.patch:
+    - fix the locale import to be compatible with python 3.9,
+      thanks Kesantielu (lp: #1924573)
+
+ -- Sebastien Bacher <seb...@ubuntu.com>  Tue, 08 Jun 2021 10:48:53 +0200
+
 nautilus-admin (1.1.9-3) unstable; urgency=medium
 
   [ Carlos Maddela ]
diff -Nru nautilus-admin-1.1.9/debian/patches/new-python-compat.patch nautilus-admin-1.1.9/debian/patches/new-python-compat.patch
--- nautilus-admin-1.1.9/debian/patches/new-python-compat.patch	1970-01-01 01:00:00.000000000 +0100
+++ nautilus-admin-1.1.9/debian/patches/new-python-compat.patch	2021-06-08 10:48:53.000000000 +0200
@@ -0,0 +1,29 @@
+From a51885e75338a9d45f8873d47db067bb81c8071a Mon Sep 17 00:00:00 2001
+From: Vitor Lopes <vmn...@gmail.com>
+Date: Thu, 3 Dec 2020 16:49:07 +0000
+Subject: [PATCH] fix for python9
+https://github.com/TomaszGasior/mushrooms-rpms/issues/41
+---
+ extension/nautilus-admin.py | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/extension/nautilus-admin.py b/extension/nautilus-admin.py
+index 683a484..4719bbc 100644
+--- a/extension/nautilus-admin.py
++++ b/extension/nautilus-admin.py
+@@ -22,7 +22,13 @@
+ require_version('Nautilus', '3.0')
+ 
+ from gi.repository import Nautilus, GObject
+-from gettext import gettext, locale, bindtextdomain, textdomain
++from gettext import gettext, bindtextdomain, textdomain
++try:
++	# python 8
++	from gettext import locale
++except ImportError:
++	# python 9
++	import locale
+ 
+ ROOT_UID = 0
+ NAUTILUS_PATH="@NAUTILUS_PATH@"
+
diff -Nru nautilus-admin-1.1.9/debian/patches/series nautilus-admin-1.1.9/debian/patches/series
--- nautilus-admin-1.1.9/debian/patches/series	2019-11-04 21:11:13.000000000 +0100
+++ nautilus-admin-1.1.9/debian/patches/series	2021-06-08 10:48:53.000000000 +0200
@@ -1,2 +1,3 @@
 out-of-place-build.patch
 update-german-translation.patch
+new-python-compat.patch

Reply via email to