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


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

2to3 adds '.' in front dir of "from dir import ..." statements (Was: [MoM] lefse migration to python 3])

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Andreas Tille <andreas@an3as.eu>
Newsgroups linux.debian.maint.python
Subject 2to3 adds '.' in front dir of "from dir import ..." statements (Was: [MoM] lefse migration to python 3])
Date Tue, 10 Sep 2019 08:00:01 +0200
Message-ID <yEHm1-4FK-1@gated-at.bofh.it> (permalink)
X-Mailbox-Line From debian-python-request@lists.debian.org Tue Sep 10 05:51:01 2019
Old-Return-Path <andreas@an3as.eu>
X-Amavis-Spam-Status No, score=-5 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, LDO_WHITELIST=-5, MEDS2=2, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=no autolearn_force=no
X-Policyd-Weight using cached result; rate: -4.6
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent NeoMutt/20170113 (1.7.2)
X-Mailing-List <debian-python@lists.debian.org> archive/latest/17300
List-ID <debian-python.lists.debian.org>
List-URL <https://lists.debian.org/debian-python/>
List-Archive https://lists.debian.org/msgid-search/20190910055047.otdspqnnnpkd55hp@an3as.eu
Approved robomod@news.nic.it
Lines 43
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Tue, 10 Sep 2019 07:50:47 +0200
X-Original-Message-ID <20190910055047.otdspqnnnpkd55hp@an3as.eu>
Xref csiph.com linux.debian.maint.python:11779

Show key headers only | View raw


Hi,

in the process of the Python3 migration the package lefse was converted
using 2to3.  The changes can be found in git[1].  I'm wondering about
the following diff created by 2to3:

  - from lefse import *
  + from .lefse import *

When calling a random binary of the resulting binary package lefse I
experienced:

$ plot_features 
Traceback (most recent call last):
  File "/usr/bin/plot_features", line 6, in <module>
    from .lefse import *
ModuleNotFoundError: No module named '__main__.lefse'; '__main__' is not a package


I think the line

   from lefse import *

should remain to keep that script functional.  I now checked another
package (cain - nothing pushed yet) and here also 2to3 is changing

   from something import *

to

   from .something import *

Could somebody please enlighten me about this added '.' which does not
seem to work?

Kind regards

      Andreas.

[1] https://salsa.debian.org/med-team/lefse

-- 
http://fam-tille.de

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


Thread

2to3 adds '.' in front dir of "from dir import ..." statements (Was:  [MoM] lefse migration to python 3]) Andreas Tille <andreas@an3as.eu> - 2019-09-10 08:00 +0200
  Re: 2to3 adds '.' in front dir of "from dir import ..." statements  (Was: [MoM] lefse migration to python 3]) Ghislain Vaillant <ghisvail@gmail.com> - 2019-09-10 08:30 +0200
  Re: 2to3 adds '.' in front dir of "from dir import ..." statements  (Was: [MoM] lefse migration to python 3]) Michael Kesper <mkesper@schokokeks.org> - 2019-09-12 09:30 +0200
    Re: 2to3 adds '.' in front dir of "from dir import ..." statements  (Was: [MoM] lefse migration to python 3]) Andreas Tille <andreas@an3as.eu> - 2019-09-12 09:50 +0200
  Re: 2to3 adds '.' in front dir of "from dir import ..." statements  (Was: [MoM] lefse migration to python 3]) Andrey Rahmatullin <wrar@debian.org> - 2019-09-12 11:10 +0200

csiph-web