Package: software-properties-common
Version: 0.96.20.2-2.1
Severity: normal
Tags: upstream
X-Debbugs-Cc: [email protected]

Dear Maintainer,

Installing a PPA yields this problem:

$ sudo add-apt-repository ppa:alessandro-strada/ppa
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 327, in
get_ppa_info
    ret = get_ppa_info_from_lp(user, ppa)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 92, in
get_ppa_info_from_lp
    return get_info_from_lp(lp_url)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 88, in
get_info_from_lp
    return _get_https_content_py3(lp_url)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 102, in
_get_https_content_py3
    lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)
TypeError: urlopen() got an unexpected keyword argument 'cafile'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 122, in <module>
    shortcut = shortcut_handler(line)
  File "/usr/lib/python3/dist-
packages/softwareproperties/SoftwareProperties.py", line 841, in
shortcut_handler
    ret = factory(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 393, in
shortcut_handler
    return PPAShortcutHandler(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 356, in
__init__
    info = get_ppa_info(self.shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 339, in
get_ppa_info
    _get_suggested_ppa_message(user, ppa))
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 296, in
_get_suggested_ppa_message
    lp_user = get_info_from_lp(LAUNCHPAD_USER_API % user)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 88, in
get_info_from_lp
    return _get_https_content_py3(lp_url)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 102, in
_get_https_content_py3
    lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)
TypeError: urlopen() got an unexpected keyword argument 'cafile'

This is because the cafile argument to urlopen was removed in Python 3.13.

However, testing appears to include both Python 3.13 and software-properties
0.96.20.2-2.1, which are incompatible.

Something like this would fix the issue; changing line 106 in
/usr/lib/python3/dist-packages/softwareproperties/ppa.py from:

        lp_page = urllib.request.urlopen(request, cafile=LAUNCHPAD_PPA_CERT)

to:

        context = ssl.create_default_context(cafile=LAUNCHPAD_PPA_CERT)
        lp_page = urllib.request.urlopen(request, context=context)

And importing ssl at the top as well.

However, this is presumably fixed in a newer version of
software-properties, but none is available. The problem here is
that I previously upgraded from "bullseye" to Debian "testing", and
there appears to be no version of the package in "testing" (though
the "stable" version is still better than this one), so it
kept the old one.

Am I doing something wrong, or is this an actual problem?


-- System Information:
Debian Release: 13.0
  APT prefers testing-security
  APT policy: (500, 'testing-security'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.33+deb13-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages software-properties-common depends on:
ii  ca-certificates              20250419
ii  gir1.2-glib-2.0              2.84.3-1
ii  gir1.2-packagekitglib-1.0    1.3.1-1
ii  python-apt-common            3.0.0
ii  python3                      3.13.3-1
ii  python3-dbus                 1.4.0-1
ii  python3-gi                   3.50.0-4+b1
ii  python3-software-properties  0.96.20.2-2.1

Versions of packages software-properties-common recommends:
ii  packagekit  1.3.1-1

software-properties-common suggests no packages.

-- no debconf information

Reply via email to