Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #12147

Bug#937262: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye)

Path csiph.com!goblin2!goblin.stu.neva.ru!aioe.org!bofh.it!news.nic.it!robomod
From Andrey Rahmatullin <wrar@debian.org>
Newsgroups linux.debian.bugs.dist, linux.debian.maint.python
Subject Bug#937262: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye)
Date Fri, 13 Dec 2019 22:40:01 +0100
Message-ID <zd0Pf-19a-5@gated-at.bofh.it> (permalink)
References <zcElH-458-1@gated-at.bofh.it> <zcOXM-2go-5@gated-at.bofh.it> <zcS5j-4lz-1@gated-at.bofh.it> <zcSyl-4vI-1@gated-at.bofh.it> <zcSym-4vI-3@gated-at.bofh.it> <zczm1-12V-7@gated-at.bofh.it> <zcTXs-5tI-15@gated-at.bofh.it> <zcUqu-5DB-5@gated-at.bofh.it> <zcXol-7oT-1@gated-at.bofh.it> <zd0vU-121-9@gated-at.bofh.it> <zczm1-12V-7@gated-at.bofh.it> <zd0vU-121-9@gated-at.bofh.it>
X-Original-To Andreas Tille <tille@debian.org>
X-Mailbox-Line From debian-bugs-dist-request@lists.debian.org Fri Dec 13 21:36:10 2019
Old-Return-Path <debbugs@buxtehude.debian.org>
X-Spam-Flag NO
X-Spam-Score -4
Reply-To Andrey Rahmatullin <wrar@debian.org>, 937262@bugs.debian.org
Resent-To debian-bugs-dist@lists.debian.org
Resent-Cc Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
X-Debian-Pr-Message followup 937262
X-Debian-Pr-Package src:pdb2pqr
X-Debian-Pr-Keywords sid help bullseye
X-Debian-Pr-Source pdb2pqr
X-Spam-Bayes score:0.0000 Tokens: new, 32; hammy, 150; neutral, 71; spammy, 0. spammytokens: hammytokens:0.000-+--H*ct:application, 0.000-+--H*ct:protocol, 0.000-+--H*ct:micalg, 0.000-+--H*ct:signed, 0.000-+--H*ct:pgp-signature
Dkim-Signature v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=wrar.name; s=20160710; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=wU4mGlNATDxdkCkiKbFm/ClXAoNc4OD7nWNMmIvJ2q8=; b=h0iu0sLvoYr65BsB4wSaeCUwZ HuZPIhQEf7SxXwhHBaGYVtEZXuee7WIvXtu5YvJF8ZZDxx9aeq8nW0iRtkoQk91FvBvuc+O9UE2fh 8t+pR8pa3pTVAPcwQ1rToyKQe9dJghCV5gBbJIRVMdD0MklK2XAyI10cPlkfC9krynGFw=;
MIME-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2hMgfIw2X+zgXrFs"
Content-Disposition inline
User-Agent Mutt/1.12.2 (2019-09-21)
X-Debian-Message from BTS
X-Mailing-List <debian-bugs-dist@lists.debian.org> archive/latest/1573696
List-ID <debian-bugs-dist.lists.debian.org>
List-URL <https://lists.debian.org/debian-bugs-dist/>
Approved robomod@news.nic.it
Lines 77
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Cc 937262@bugs.debian.org, Debian Python <debian-python@lists.debian.org>
X-Original-Date Sat, 14 Dec 2019 02:34:28 +0500
X-Original-Message-ID <20191213213428.GE2390860@belkar.wrar.name>
X-Original-References <alpine.DEB.2.21.1912121633330.9864@bear.techie.net> <20191213084947.GQ26401@an3as.eu> <20191213121845.GB2390860@belkar.wrar.name> <20191213124034.GU26401@an3as.eu> <20191213124642.GC2390860@belkar.wrar.name> <E1i3bMc-0005Ex-OJ@paradis.debian.org> <20191213141632.GX26401@an3as.eu> <20191213144922.GB4183@an3as.eu> <20191213174945.GD2390860@belkar.wrar.name> <20191213211003.GD4183@an3as.eu> <E1i3bMc-0005Ex-OJ@paradis.debian.org> <20191213211003.GD4183@an3as.eu>
Xref csiph.com linux.debian.bugs.dist:987115 linux.debian.maint.python:12147

Cross-posted to 2 groups.

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Fri, Dec 13, 2019 at 10:10:03PM +0100, Andreas Tille wrote:
> i$ pdb2pqr
> Traceback (most recent call last):
>   File "/usr/bin/pdb2pqr", line 52, in <module>
>     from main import mainCommand
>   File "/usr/share/pdb2pqr/main.py", line 77, in <module>
>     import extensions
>   File "/usr/share/pdb2pqr/extensions/__init__.py", line 56, in <module>
>     extDict[extName] = __import__(extName,globals(),locals(),[], -1)
> ValueError: level must be >= 0

"""
level specifies whether to use absolute or relative imports. The default
is -1 which indicates both absolute and relative imports will be
attempted. 0 means only perform absolute imports.  Positive values for
level indicate the number of parent directories to search relative to the
directory of the module calling __import__().
"""
https://docs.python.org/2.7/library/functions.html#__import__

-1 was removed in 3.3 as implicit relative import are not supported in
3.x. As this code seems to use relative imports you need to change -1 to
1.

> So I tried:
> 
> --- a/extensions/__init__.py
> +++ b/extensions/__init__.py
> @@ -53,7 +53,7 @@ _extList = [name for _, name, _ in pkgutil.iter_modules(__path__)]
>  extDict = {}
>  
>  for extName in _extList:
> -    extDict[extName] = __import__(extName,globals(),locals(),[], -1)
> +    extDict[extName] = __import__(extName,globals(),locals(),[], 0)^M

Mindlessly changing the code is almost always a bad idea...

>   File "/usr/share/pdb2pqr/extensions/__init__.py", line 57, in <module>
>     extDict[extName] = __import__(extName,globals(),locals(),[], 0)
> ModuleNotFoundError: No module named 'chi'
This is expected as it now tries to do "import chi". With 1 it should try
"from . import chi". This fails later, as the source also has implicit
relative imports that needs to be fixed, for example "from aconf import"
in src/utilities.py.

-- 
WBR, wRAR

Back to linux.debian.maint.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Bug#937262: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye) Andreas Tille <andreas@an3as.eu> - 2019-12-12 17:20 +0100
  Re: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2  removal in sid/bullseye)) Scott Talbert <swt@techie.net> - 2019-12-12 21:50 +0100
    Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye)) Andreas Tille <andreas@an3as.eu> - 2019-12-13 10:00 +0100
      Re: Bug#937262: Help with scons needed (Was: Help needed (Was:  pdb2pqr: Python2 removal in sid/bullseye)) Andrey Rahmatullin <wrar@debian.org> - 2019-12-13 11:30 +0100
        Re: Bug#937262: Help with scons needed (Was: Help needed (Was:  pdb2pqr: Python2 removal in sid/bullseye)) Andreas Tille <andreas@an3as.eu> - 2019-12-13 13:10 +0100
      Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye)) Andrey Rahmatullin <wrar@debian.org> - 2019-12-13 13:30 +0100
        Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye)) Andreas Tille <tille@debian.org> - 2019-12-13 13:50 +0100
          Bug#937262: Help with scons needed (Was: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye)) Andreas Tille <tille@debian.org> - 2019-12-13 16:00 +0100
            Re: Bug#937262: Help with scons needed (Was: Help needed (Was:  pdb2pqr: Python2 removal in sid/bullseye)) Andrey Rahmatullin <wrar@debian.org> - 2019-12-13 19:00 +0100
              Bug#937262: Help needed (Was: pdb2pqr: Python2 removal in sid/bullseye) Andrey Rahmatullin <wrar@debian.org> - 2019-12-13 22:40 +0100

csiph-web