Package: changeo
Version: 1.2.0-1
Severity: grave
Tags: patch
Justification: renders package unusable
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu lunar ubuntu-patch

Dear maintainers,

changeo fails its autopkgtests with python3.11, revealing a bug in the
software, because it uses a mode flag to open() which has been deprecated
since python 3 and is now obsolete in python 3.11:

[...]
Traceback (most recent call last):
  File "/usr/bin/CreateGermlines.py", line 354, in <module>
    createGermlines(**args_dict)
  File "/usr/bin/CreateGermlines.py", line 94, in createGermlines
    reference_dict = readGermlines(references)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/changeo/IO.py", line 2201, in 
readGermlines
    with open(file_name, 'rU') as file_handle:
         ^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: 'rU'
[...]

  
(https://ci.debian.net/data/autopkgtest/testing/amd64/c/changeo/30225356/log.gz)

I'm assuming this is fairly core functionality in the package so have marked
the bug grave.  If it's not, then the autopkgtest regression is still
serious.

I've applied the attached trivial patch in Ubuntu to fix the regression
there.

Thanks for considering,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru changeo-1.2.0/debian/patches/open-U-obsolete.patch 
changeo-1.2.0/debian/patches/open-U-obsolete.patch
--- changeo-1.2.0/debian/patches/open-U-obsolete.patch  1969-12-31 
16:00:00.000000000 -0800
+++ changeo-1.2.0/debian/patches/open-U-obsolete.patch  2023-01-10 
21:53:30.000000000 -0800
@@ -0,0 +1,21 @@
+Description: Drop obsolete "U" mode passed to open()
+ The "U" mode has been deprecated in python since python3 and has had no
+ effect.  In python 3.11, it is now disallowed.  Drop this mode flag that
+ causes runtime failures.
+Author: Steve Langasek <steve.langa...@ubuntu.com>
+Last-Update: 2023-01-10
+Forwarded: no
+
+Index: changeo-1.2.0/changeo/IO.py
+===================================================================
+--- changeo-1.2.0.orig/changeo/IO.py
++++ changeo-1.2.0/changeo/IO.py
+@@ -2198,7 +2198,7 @@
+     repo_dict = {}
+     duplicates = []
+     for file_name in repo_files:
+-        with open(file_name, 'rU') as file_handle:
++        with open(file_name, 'r') as file_handle:
+             germlines = SeqIO.parse(file_handle, 'fasta')
+             for g in germlines:
+                 germ_key = getAllele(g.description, 'first') if not asis else 
g.id
diff -Nru changeo-1.2.0/debian/patches/series 
changeo-1.2.0/debian/patches/series
--- changeo-1.2.0/debian/patches/series 1969-12-31 16:00:00.000000000 -0800
+++ changeo-1.2.0/debian/patches/series 2023-01-10 21:52:41.000000000 -0800
@@ -0,0 +1 @@
+open-U-obsolete.patch

Reply via email to