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


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

Bug#939181: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye

Path csiph.com!weretis.net!feeder7.news.weretis.net!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Andreas Tille <tille@debian.org>
Newsgroups linux.debian.bugs.dist, linux.debian.maint.python
Subject Bug#939181: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye
Date Fri, 13 Sep 2019 12:10:02 +0200
Message-ID <yFQGC-2ON-1@gated-at.bofh.it> (permalink)
References <yBKT7-8wu-11@gated-at.bofh.it> <yFaem-7xs-3@gated-at.bofh.it> <yFbDr-ee-7@gated-at.bofh.it> <yFbWN-lQ-9@gated-at.bofh.it> <yFryx-2BZ-1@gated-at.bofh.it> <yFt7j-3w7-9@gated-at.bofh.it> <yFxXj-6ZH-7@gated-at.bofh.it> <yFCDD-1Fz-1@gated-at.bofh.it> <yBKT7-8wu-11@gated-at.bofh.it> <yFCDD-1Fz-1@gated-at.bofh.it>
X-Mailbox-Line From debian-bugs-dist-request@lists.debian.org Fri Sep 13 10:06:12 2019
Old-Return-Path <debbugs@buxtehude.debian.org>
X-Spam-Flag NO
X-Spam-Score -4.2
Reply-To Andreas Tille <tille@debian.org>, 939181@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 939181
X-Debian-Pr-Package src:cycle
X-Debian-Pr-Keywords help sid bullseye
X-Debian-Pr-Source cycle
X-Spam-Bayes score:0.0000 Tokens: new, 23; hammy, 150; neutral, 147; spammy, 0. spammytokens: hammytokens:0.000-+--python3, 0.000-+--H*f:sk:alpine., 0.000-+--unmaintained, 0.000-+--H*UA:NeoMutt, 0.000-+--H*u:NeoMutt
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent NeoMutt/20170113 (1.7.2)
X-Debian-Message from BTS
X-Mailing-List <debian-bugs-dist@lists.debian.org> archive/latest/1558392
List-ID <debian-bugs-dist.lists.debian.org>
List-URL <https://lists.debian.org/debian-bugs-dist/>
Approved robomod@news.nic.it
Lines 67
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Cc debian-python@lists.debian.org
X-Original-Date Fri, 13 Sep 2019 12:03:37 +0200
X-Original-Message-ID <20190913100337.4etcy4tn4ka3r2ez@an3as.eu>
X-Original-References <alpine.DEB.2.21.1909012302200.30297@bear.techie.net> <20190911123354.GA16873@debian.org> <20190911141234.7hwnsil5bp2m6cew@an3as.eu> <20190911143233.GC1706@belkar.wrar.name> <20190912071708.5olnqppyshvtus2n@an3as.eu> <20190912085732.GD1706@belkar.wrar.name> <20190912140906.wfagwtol4ljcinhz@an3as.eu> <eda346de-9ea7-57c8-0639-963507054e28@schokokeks.org> <alpine.DEB.2.21.1909012302200.30297@bear.techie.net> <eda346de-9ea7-57c8-0639-963507054e28@schokokeks.org>
Xref csiph.com linux.debian.bugs.dist:974968 linux.debian.maint.python:11805

Cross-posted to 2 groups.

Show key headers only | View raw


Hi,

On Thu, Sep 12, 2019 at 09:08:04PM +0200, Michael Kesper wrote:
> > Since I do not have much experience with hashlib I'd be happy if 
> > someone might be able to proof-read `def Save_Cycle` in 
> > save_load.py.
> 
> This does not have anything to do with hashlib per se.
> It's just the usual mess of mixing bytestrings with strings.
> You often don't notice in Python2, it just introduces subtle bugs.
> Python3 is more strict here and doesn't allow it.
> 
> Try this:
> 
> tmp = rt.encrypt('Cycle{}'.format(pickle.dumps(objSave)))

Thanks to this hint and the other hints by Peter Green, I'm now a
bit further.
 
> As an explanation:
> 
> Python 3.7.3 (default, Apr  3 2019, 05:39:12)
> ...

Thanks as well.

> P.S.: The code is in a bad state regarding whitespace / indentation.
> This is critical to get right in Python (e.g. after a for there _has to_
> be an indentation added, Python normally uses four spaces, no tabs).

I'm aware that the code is not good - there are other issues than spaces
and tabs for instance I removed an instance of os.tempnam where upstream
simply had overridden the automatic warning.  Its unmaintained upstream
as well.

I've seen other code in Debian which is not good as well.  Its rather a
philosophical question whether it is better to drop it from Debian (and
leave its users alone may be fiddling around with the upstream code
themselves) or whether we try our best to make the code at least
acceptable.  I usually subscribe to the latter and think there is no
right or wrong here.

I'm not really sure whether we might manage in this case.  After
implementing all hints I'm now stumbling upon:


Traceback (most recent call last):
  File "/usr/bin/cycle", line 83, in OnCloseWindow
    Save_Cycle(cycle.name, cycle.passwd, cycle.file)
  File "/usr/share/cycle/save_load.py", line 46, in Save_Cycle
    tmp = rt.encrypt('Cycle{}'.format(pickle.dumps(objSave)))
  File "/usr/share/cycle/p_rotor.py", line 63, in encrypt
    return self.cryptmore(buf, 0)
  File "/usr/share/cycle/p_rotor.py", line 88, in cryptmore
    c = rotors[i][c ^ pos[i]]
TypeError: unsupported operand type(s) for ^: 'str' and 'int'


I think an  "int(c) ^ pos[i]"  could do here - but I'd like
to get some confirmation first.

Kind regards

     Andreas.

-- 
http://fam-tille.de

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


Thread

Bug#939181: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye Andreas Tille <andreas@an3as.eu> - 2019-09-11 16:20 +0200
  Bug#939181: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye Andrey Rahmatullin <wrar@debian.org> - 2019-09-11 17:10 +0200
    Bug#939181: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye Andreas Tille <tille@debian.org> - 2019-09-12 09:30 +0200
      Bug#939181: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye Andrey Rahmatullin <wrar@debian.org> - 2019-09-12 11:10 +0200
        Re: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye Andreas Tille <andreas@an3as.eu> - 2019-09-12 16:10 +0200
          Re: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye Michael Kesper <mkesper@schokokeks.org> - 2019-09-12 21:10 +0200
            Bug#939181: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye Andreas Tille <tille@debian.org> - 2019-09-13 12:10 +0200

csiph-web