Bug#1057157: bookworm-pu: package spyder/5.4.2+ds-5+deb12u1

Julian Gilbey jdg at debian.org
Thu Nov 30 20:43:15 GMT 2023


Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian.org at packages.debian.org
Usertags: pu
X-Debbugs-Cc: spyder at packages.debian.org, Samuel Thibault <sthibault at debian.org>
Control: affects -1 + src:spyder

[ Reason ]
This is a patch for
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054475

This bug prevents auto-detection of the environment language (using
the Python locale.getdefaultlocale() function) when Spyder is first
run.  After that, Spyder saves the language and uses that saved value
for future use; this setting can be changed in the Spyder preferences.
The upstream patch fixes the error that caused this bug by updating
the list of available translations.

The Debian bug was filed as "normal" severity.  It should probably be
"important", but I have not changed the severity.  (It is definitely
not more that "important", as the language can still be changed by the
user after Spyder has started in English.)  The reporter specifically
suggested that this should be fixed in stable, and with such a simple
patch, I tend to agree.

The patch I have used is the complete upstream patch, minus a minor
tweak to some function documentation.  This is a little larger than
the proposed patch in the Debian bug report, but it protects against
any other oversight in the list of translations.

[ Impact ]
When starting Spyder for the first time in a non-English locale, the
interface will be in English rather than the locale language, even if
a translation for that locale is provided by Spyder.

[ Tests ]
It appears that there are no tests for this piece of code (hence why
this bug was not caught automatically).  The package's autopkgtest
suite still passes, and the updated package has been manually tested
on a bookworm system to ensure that it no longer has this bug.

[ Risks ]
There seem to be few risks with this minor patch.

[ Checklist ]
  [x] *all* changes are documented in the d/changelog
  [x] I reviewed all changes and I approve them
  [x] attach debdiff against the package in (old)stable
  [x] the issue is verified as fixed in unstable

[ Changes ]
See the patch: it fixes the list of available translations and no
longer defaults to English if the list of translations is out of
date.

[ Other info ]
I have not yet uploaded the new version to ftp-master.d.o; I await
your approval before doing so.
-------------- next part --------------
diff -Nru spyder-5.4.2+ds/debian/changelog spyder-5.4.2+ds/debian/changelog
--- spyder-5.4.2+ds/debian/changelog	2023-02-23 10:59:49.000000000 +0000
+++ spyder-5.4.2+ds/debian/changelog	2023-11-30 20:22:17.000000000 +0000
@@ -1,3 +1,9 @@
+spyder (5.4.2+ds-5+deb12u1) stable; urgency=medium
+
+  * Fix interface language auto-configuration (closes: #1054475)
+
+ -- Julian Gilbey <jdg at debian.org>  Thu, 30 Nov 2023 20:22:17 +0000
+
 spyder (5.4.2+ds-5) unstable; urgency=medium
 
   * Fix translation-loading patch (see discussion at
diff -Nru spyder-5.4.2+ds/debian/patches/enable-i18n.patch spyder-5.4.2+ds/debian/patches/enable-i18n.patch
--- spyder-5.4.2+ds/debian/patches/enable-i18n.patch	1970-01-01 01:00:00.000000000 +0100
+++ spyder-5.4.2+ds/debian/patches/enable-i18n.patch	2023-11-30 20:22:17.000000000 +0000
@@ -0,0 +1,76 @@
+From: Carlos Cordoba <ccordoba12 at gmail.com>
+Date: Thu, 26 Oct 2023 13:52:55 -0500
+Subject: [PATCH] Backport PR #21451: Fix interface language auto-configuration
+Description:
+  Commit 7d99df57dc977ee00d92c959102409be1683df24
+  This bug prevented auto-configuration of the interface language when
+  Spyder is started for the first time.  (After that, the interface language
+  is stored in the preferences file and can be changed via the preferences
+  dialog.)
+  A minor cosmetic fix to the function documentation has been removed from
+  this patch.
+Last-Update: 2023-11-30
+Origin: upstream, https://github.com/spyder-ide/spyder/pull/21461
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054475
+
+--- a/spyder/config/base.py
++++ b/spyder/config/base.py
+@@ -366,20 +366,24 @@
+ # This needs to be updated every time a new language is added to spyder, and is
+ # used by the Preferences configuration to populate the Language QComboBox
+ LANGUAGE_CODES = {
+-    'en': u'English',
+-    'fr': u'Fran?ais',
+-    'es': u'Espa?ol',
+-    'hu': u'Magyar',
+-    'pt_BR': u'Portugu?s',
+-    'ru': u'???????',
+-    'zh_CN': u'????',
+-    'ja': u'???',
+-    'de': u'Deutsch',
+-    'pl': u'Polski'
++    'en': 'English',
++    'fr': 'Fran?ais',
++    'es': 'Espa?ol',
++    'hu': 'Magyar',
++    'pt_BR': 'Portugu?s',
++    'ru': '???????',
++    'zh_CN': '????',
++    'ja': '???',
++    'de': 'Deutsch',
++    'pl': 'Polski',
++    'fa': 'Persian',
++    'hr': 'Croatian',
++    'te': 'Telugu',
++    'uk': 'Ukrainian',
+ }
+ 
+ # Disabled languages because their translations are outdated or incomplete
+-DISABLED_LANGUAGES = ['hu', 'pl']
++DISABLED_LANGUAGES = ['fa', 'hr', 'hu', 'pl', 'te', 'uk']
+ 
+ 
+ def get_available_translations():
+@@ -400,14 +404,19 @@
+ 
+     # Check that there is a language code available in case a new translation
+     # is added, to ensure LANGUAGE_CODES is updated.
++    retlangs = []
+     for lang in langs:
+         if lang not in LANGUAGE_CODES:
+             if DEV:
+                 error = ('Update LANGUAGE_CODES (inside config/base.py) if a '
+-                         'new translation has been added to Spyder')
++                         'new translation has been added to Spyder. '
++                         'Currently missing ' + lang)
+                 print(error)  # spyder: test-skip
+-            return ['en']
+-    return langs
++                return ['en']
++        else:
++            retlangs.append(lang)
++
++    return retlangs
+ 
+ 
+ def get_interface_language():
diff -Nru spyder-5.4.2+ds/debian/patches/series spyder-5.4.2+ds/debian/patches/series
--- spyder-5.4.2+ds/debian/patches/series	2023-02-23 10:59:49.000000000 +0000
+++ spyder-5.4.2+ds/debian/patches/series	2023-11-30 20:22:17.000000000 +0000
@@ -6,3 +6,4 @@
 test-fixes-3.11.patch
 fix-l10n-3.11-handling.patch
 make-translations-singleton.patch
+enable-i18n.patch


More information about the debian-science-maintainers mailing list