Opened 11 months ago

Closed 4 months ago

#3476 closed bug (Fixed)

GTKUI logs error when enabling plugin.

Reported by: mhertz Owned by:
Priority: minor Milestone: 2.0.6
Component: GTK UI Version: 2.0.0
Keywords: Cc:

Description

In latest python-setuptools 1.57 there's a metadata change causing the description being added to actual payload of generated PKG-INFO and not as header-field like previously. The metadata-spec states it CAN do this, but always does in my tests when using this version. Whenever enabling a plugin, then will show an error in log/terminal about 'None' not supported as first argument, as now is in payload and not in a 'Description' header field anymore, and per spec returns None in that case. I guess can be changed to check for this circumstance, but I quickly just changed line 1147 in deluge/ui/gtk3/preferences.py from: '

self.builder.get_object('label_plugin_details').set_text(
            plugin_info['Description']
        )

Into instead:

 self.builder.get_object('label_plugin_details').set_text(
            plugin_info['Summary']
        )

Which works for old and new PKG-INFO generated files.

Here's two examples of generated AutoAdd?.egg-info/PKG-INFO files from unmodified deluge git clone and built with 'python setup.py bdist_egg', first with latest python-setuptools 1.57, and next with previous python-setuptools 1.56.2(both python3, as on arch, python means python3, and btw using latest python 3.9.5 also):

Metadata-Version: 2.1
Name: AutoAdd
Version: 1.8
Summary: Monitors folders for .torrent files.
Home-page: http://dev.deluge-torrent.org/wiki/Plugins/AutoAdd
Author: Chase Sterling, Pedro Algarvio
Author-email: chase.sterling@gmail.com, pedro@algarvio.me
License: GPLv3
Platform: UNKNOWN

Monitors folders for .torrent files.

Metadata-Version: 2.1
Name: AutoAdd
Version: 1.8
Summary: Monitors folders for .torrent files.
Home-page: http://dev.deluge-torrent.org/wiki/Plugins/AutoAdd
Author: Chase Sterling, Pedro Algarvio
Author-email: chase.sterling@gmail.com, pedro@algarvio.me
License: GPLv3
Description: Monitors folders for .torrent files.
Platform: UNKNOWN

Thanks in advance.

Change History (5)

comment:1 Changed 11 months ago by mhertz

  • Component changed from Unknown to GTK UI

comment:2 Changed 4 months ago by Cas

  • Milestone changed from needs verified to 2.0.6

comment:3 Changed 4 months ago by Cas

Some links to get further details on the issue:

https://packaging.python.org/en/latest/specifications/core-metadata/#description

Changed in version 2.1: This field may be specified in the message body instead.

Alternatively, the distribution’s description may instead be provided in the message body (i.e., after a completely blank line following the headers, with no indentation or other special formatting necessary).

A related warehouse issue: https://github.com/pypa/warehouse/issues/8174

comment:4 Changed 4 months ago by Cas

Thanks for reporting!

This needing fixing when parsing the metadata in the Pluginmanagerbase so that all UIs would not encounter this error.

Fixed in [2351d658449] and [c3cd7f5e5cd1]

comment:5 Changed 4 months ago by Cas

  • Resolution set to Fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.