Hello community,

here is the log from the commit of package beets for openSUSE:Factory checked 
in at 2020-10-28 10:02:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/beets (Old)
 and      /work/SRC/openSUSE:Factory/.beets.new.3463 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "beets"

Wed Oct 28 10:02:17 2020 rev:7 rq:844499 version:1.4.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/beets/beets.changes      2019-06-30 
10:22:05.179674725 +0200
+++ /work/SRC/openSUSE:Factory/.beets.new.3463/beets.changes    2020-10-28 
10:02:39.071323959 +0100
@@ -1,0 +2,8 @@
+Wed Oct 28 06:17:51 UTC 2020 - Antonio Larrosa <alarr...@suse.com>
+
+- Add patch to fix a crash due to invalid use of the ast module
+  (boo#1178199):
+  * 0001-Compatibility-with-breaking-changes-to-the-ast-module.patch
+- Use %license
+
+-------------------------------------------------------------------

New:
----
  0001-Compatibility-with-breaking-changes-to-the-ast-module.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ beets.spec ++++++
--- /var/tmp/diff_new_pack.gocTlt/_old  2020-10-28 10:02:40.767325147 +0100
+++ /var/tmp/diff_new_pack.gocTlt/_new  2020-10-28 10:02:40.771325149 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package beets
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -22,11 +22,13 @@
 Summary:        Music tagger and library organizer
 License:        MIT
 Group:          Productivity/Multimedia/Sound/Players
-Url:            http://beets.io/
+URL:            http://beets.io/
 Source:         
https://github.com/beetbox/beets/releases/download/v%{version}/%{name}-%{version}.tar.gz
 Patch0:         0001-Fixed-failing-test-where.patch
 # PATCH-FIX-UPSTREAM fix_test_command_line_option_relative_to_working_dir.diff 
alarr...@suse.de - Fixes one of the tests to run successfully
 Patch1:         fix_test_command_line_option_relative_to_working_dir.diff
+# PATCH-FIX-UPSTREAM 
0001-Compatibility-with-breaking-changes-to-the-ast-module.patch -- Fix from 
upstream for boo#1178199
+Patch2:         
0001-Compatibility-with-breaking-changes-to-the-ast-module.patch
 BuildRequires:  python3-PyYAML
 BuildRequires:  python3-Unidecode
 BuildRequires:  python3-devel
@@ -108,6 +110,7 @@
 %setup -q -n beets-%{version}
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 python3 setup.py build
@@ -117,7 +120,8 @@
 
 %files
 %defattr(-,root,root,-)
-%doc LICENSE README.rst
+%doc README.rst
+%license LICENSE
 %{_bindir}/beet
 %{python3_sitelib}/*
 

++++++ 0001-Compatibility-with-breaking-changes-to-the-ast-module.patch ++++++
>From dab0c1f9abda5b17cc7488f89a6fe08be7bc56a0 Mon Sep 17 00:00:00 2001
From: wisp3rwind <17089248+wisp3rw...@users.noreply.github.com>
Date: Tue, 9 Jun 2020 19:34:31 +0200
Subject: [PATCH] compatibility with breaking changes to the ast module

new in 3.10, also backported to 3.8 and 3.9: 
https://github.com/python/cpython/pull/20649
In fact, our generation of some Literals has been invalid since Python
3.4, fix that too.
---
 beets/util/functemplate.py | 29 ++++++++++++++++++++---------
 docs/changelog.rst         |  1 +
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/beets/util/functemplate.py b/beets/util/functemplate.py
index af22b79082..266534a9b4 100644
--- a/beets/util/functemplate.py
+++ b/beets/util/functemplate.py
@@ -73,15 +73,26 @@ def ex_literal(val):
     """An int, float, long, bool, string, or None literal with the given
     value.
     """
-    if val is None:
-        return ast.Name('None', ast.Load())
-    elif isinstance(val, six.integer_types):
-        return ast.Num(val)
-    elif isinstance(val, bool):
-        return ast.Name(bytes(val), ast.Load())
-    elif isinstance(val, six.string_types):
-        return ast.Str(val)
-    raise TypeError(u'no literal for {0}'.format(type(val)))
+    if sys.version_info[:2] < (3, 4):
+        if val is None:
+            return ast.Name('None', ast.Load())
+        elif isinstance(val, six.integer_types):
+            return ast.Num(val)
+        elif isinstance(val, bool):
+            return ast.Name(bytes(val), ast.Load())
+        elif isinstance(val, six.string_types):
+            return ast.Str(val)
+        raise TypeError(u'no literal for {0}'.format(type(val)))
+    elif sys.version_info[:2] < (3, 6):
+        if val in [None, True, False]:
+            return ast.NameConstant(val)
+        elif isinstance(val, six.integer_types):
+            return ast.Num(val)
+        elif isinstance(val, six.string_types):
+            return ast.Str(val)
+        raise TypeError(u'no literal for {0}'.format(type(val)))
+    else:
+        return ast.Constant(val)
 
 
 def ex_varassign(name, expr):
#diff --git a/docs/changelog.rst b/docs/changelog.rst
#index 5ecffb8e38..453d22305a 100644
#--- a/docs/changelog.rst
#+++ b/docs/changelog.rst
#@@ -213,6 +213,7 @@ Fixes:
# * :doc:`/plugins/lyrics`: Fix crash when writing ReST files for a query 
without
#   results or fetched lyrics
#   :bug:`2805`
#+* Adapt to breaking changes in Python's ``ast`` module in 3.8
# 
# For plugin developers:
# 

Reply via email to