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


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

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

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From peter green <plugwash@p10link.net>
Newsgroups linux.debian.bugs.dist, linux.debian.maint.python
Subject Bug#939181: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye
Date Thu, 12 Sep 2019 21:50:02 +0200
Message-ID <yFDgm-1VX-1@gated-at.bofh.it> (permalink)
References <yBKT7-8wu-11@gated-at.bofh.it>
X-Mailbox-Line From debian-bugs-dist-request@lists.debian.org Thu Sep 12 19:45:12 2019
Old-Return-Path <debbugs@buxtehude.debian.org>
X-Spam-Flag NO
X-Spam-Score -3.95
Reply-To peter green <plugwash@p10link.net>, 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, 19; hammy, 150; neutral, 74; spammy, 0. spammytokens: hammytokens:0.000-+--python3, 0.000-+--H*u:60.0, 0.000-+--Hx-spam-relays-external:!IPv6, 0.000-+--Python2, 0.000-+--H*RU:!IPv6
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2
MIME-Version 1.0
Content-Type multipart/alternative; boundary="------------ADFFC86D114349F8BB90CD1A"
Content-Language en-US
X-Debian-Message from BTS
X-Mailing-List <debian-bugs-dist@lists.debian.org> archive/latest/1558303
List-ID <debian-bugs-dist.lists.debian.org>
List-URL <https://lists.debian.org/debian-bugs-dist/>
Approved robomod@news.nic.it
Lines 89
Organization linux.* mail to news gateway
Sender robomod@news.nic.it
X-Original-Date Thu, 12 Sep 2019 20:41:51 +0100
X-Original-Message-ID <c0d72125-2943-9c67-fd97-9cc96beb3d66@p10link.net>
X-Original-References <alpine.DEB.2.21.1909012302200.30297@bear.techie.net>
Xref csiph.com linux.debian.bugs.dist:974900 linux.debian.maint.python:11804

Cross-posted to 2 groups.

Show key headers only | View raw


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

> but this leads later to
>
> Traceback (most recent call last):
>    File "cycle.py", line 83, in OnCloseWindow
>      Save_Cycle(cycle.name, cycle.passwd, cycle.file)
>    File "/home/andreas/debian-maintain/salsa/med-team/cycle/save_load.py", line 46, in Save_Cycle
>      tmp=rt.encrypt( 'Cycle'+pickle.dumps(objSave) )
> TypeError: can only concatenate str (not "bytes") to str
String handling changed significantly between python2 and python3. Python 2 is "byte strings by default", type "str" was used for byte strings and type "unicode" was used for unicode strings. Implicit conversions between the two were allowed.

Python 3 is "unicode by default", type "bytes" is used for byte strings and type "str" is used for unicode strings. There is no implict conversion between unicode strings and byte strings.

"pickle.dumps" returned a bytes object, and you tried to concatenate it to a str object. You need to change 'Cycle' to b'Cycle'.

Also python 3 bytes objects behave a bit differently from python 2 str objects. To accommodate this I believe you need the following changes in p_rotor.py

"|for c in map(ord, buf):|" -> "|for c in buf:|"
"|return ''.join(map(chr, outbuf))|" -> "|return bytes(outbuf)|"
"|for c in map(ord, key):|" -> "for c in key:"

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


Thread

Bug#939181: [Help] Re: Bug#939181: cycle: Python2 removal in sid/bullseye peter green <plugwash@p10link.net> - 2019-09-12 21:50 +0200

csiph-web