chiark / gitweb /
make-secnet-sites: Do ascii conversion after % format
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 12:10:50 +0000 (12:10 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 16 Feb 2020 12:10:50 +0000 (12:10 +0000)
In Python 3.4 (jessie) the % operator cannot take a bytes format.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
make-secnet-sites

index a84479c..70fa7a4 100755 (executable)
@@ -591,10 +591,10 @@ class rsakey (pubkey):
                self.n=w[3].bignum_10('rsa','rsa n')
                if len(w) >= 5: w[4].email()
                self.a='rsa1'
-               self.d=base91s_encode(b'%d %s %s' %
-                                     (self.l,
-                                      self.e.encode('ascii'),
-                                      self.n.encode('ascii')))
+               self.d=base91s_encode(('%d %s %s' %
+                                      (self.l,
+                                       self.e,
+                                       self.n)).encode('ascii'))
                # ^ this allows us to use the pubkey.forsites()
                # method for output in versions>=2
        def __str__(self):