<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>
<blockquote type="cite">
<pre>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</pre>
</blockquote>
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.<br>
<br>
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.<br>
<br>
"pickle.dumps" returned a bytes object, and you tried to
concatenate it to a str object. You need to change 'Cycle' to
b'Cycle'.<br>
<br>
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<br>
<br>
"<code><span class="k">for</span> <span class="n">c</span> <span
class="ow">in</span> <span class="nb">map</span><span
class="p">(</span><span class="nb">ord</span><span class="p">,</span>
<span class="n">buf</span><span class="p">):</span></code>"
-> "<code><span class="k">for</span> <span class="n">c</span>
<span class="ow">in</span> <span class="nb"></span><span
class="p"></span><span class="nb"></span><span class="p"></span><span
class="n">buf</span><span class="p">:</span></code>"<br>
"<code><span class="k">return</span> <span class="s">''</span><span
class="o">.</span><span class="n">join</span><span class="p">(</span><span
class="nb">map</span><span class="p">(</span><span class="nb">chr</span><span
class="p">,</span> <span class="n">outbuf</span><span
class="p">))</span></code>" -> "<code><span class="k">return</span>
bytes(<span class="n">outbuf</span><span class="p">)</span></code>"<br>
"<code><span id="LC187" class="line" lang="python"><span class="k">for</span>
<span class="n">c</span> <span class="ow">in</span> <span
class="nb">map</span><span class="p">(</span><span
class="nb">ord</span><span class="p">,</span> <span
class="n">key</span><span class="p">):</span></span></code>"
-> "for c in key:"<br>
</p>
</body>
</html>