[Python-modules-commits] r21970 - in packages/python-crypto/trunk/debian (4 files)

sramacher-guest at users.alioth.debian.org sramacher-guest at users.alioth.debian.org
Mon May 28 16:40:22 UTC 2012


    Date: Monday, May 28, 2012 @ 16:40:19
  Author: sramacher-guest
Revision: 21970

  - fix-py3-errors.patch: Fix Python 3 compatibility issues revealed by the
    reenabled tests.
  - fix-except-shadows-builtin.patch: Fix 'except shadows bultin' error
    found by lintian4python.

Added:
  packages/python-crypto/trunk/debian/patches/fix-except-shadows-builtin.patch
  packages/python-crypto/trunk/debian/patches/fix-py3-errors.patch
Modified:
  packages/python-crypto/trunk/debian/changelog
  packages/python-crypto/trunk/debian/patches/series

Modified: packages/python-crypto/trunk/debian/changelog
===================================================================
--- packages/python-crypto/trunk/debian/changelog	2012-05-28 13:10:17 UTC (rev 21969)
+++ packages/python-crypto/trunk/debian/changelog	2012-05-28 16:40:19 UTC (rev 21970)
@@ -7,6 +7,10 @@
     - fix-epydoc-ignore.patch: Mark as forwarded.
     - reenable-redefined-tests.patch: Reenable tests that have been redefined.
       Thanks to Jakub Wilk's lintian4python.
+    - fix-py3-errors.patch: Fix Python 3 compatibility issues revealed by the
+      reenabled tests.
+    - fix-except-shadows-builtin.patch: Fix 'except shadows bultin' error
+      found by lintian4python.
   * debian/compat: Bump to 9.
   * debian/control: Bump Build-Dep on debhelper to >= 9.
   * debian/rules:

Added: packages/python-crypto/trunk/debian/patches/fix-except-shadows-builtin.patch
===================================================================
--- packages/python-crypto/trunk/debian/patches/fix-except-shadows-builtin.patch	                        (rev 0)
+++ packages/python-crypto/trunk/debian/patches/fix-except-shadows-builtin.patch	2012-05-28 16:40:19 UTC (rev 21970)
@@ -0,0 +1,19 @@
+Description: Fix 'except shadows bultin' error.
+ Thanks to lintian4python for finding it.
+Author: Sebastian Ramacher <s.ramacher at gmx.at>
+Last-Update: 2012-05-28
+Forwarded: https://github.com/dlitz/pycrypto/pull/18
+
+diff --git a/lib/Crypto/PublicKey/RSA.py b/lib/Crypto/PublicKey/RSA.py
+index 99d851d..27c23be 100644
+--- a/lib/Crypto/PublicKey/RSA.py
++++ b/lib/Crypto/PublicKey/RSA.py
+@@ -582,7 +582,7 @@ class RSAImplementation(object):
+                     if privateKey.isType('OCTET STRING'):
+                         return self._importKeyDER(privateKey.payload)
+ 
+-        except ValueError, IndexError:
++        except (ValueError, IndexError):
+             pass
+ 
+         raise ValueError("RSA key format is not supported")


Property changes on: packages/python-crypto/trunk/debian/patches/fix-except-shadows-builtin.patch
___________________________________________________________________
Added: svn:keywords
   + Id

Added: packages/python-crypto/trunk/debian/patches/fix-py3-errors.patch
===================================================================
--- packages/python-crypto/trunk/debian/patches/fix-py3-errors.patch	                        (rev 0)
+++ packages/python-crypto/trunk/debian/patches/fix-py3-errors.patch	2012-05-28 16:40:19 UTC (rev 21970)
@@ -0,0 +1,35 @@
+Description: Fix Python 3 erros uncovered by reenable-redefined-tests.patch.
+Author: Sebastian Ramacher <s.ramacher at gmx.at>
+Last-Update: 2012-05-28
+Forwarded: https://github.com/dlitz/pycrypto/pull/16
+
+diff --git a/lib/Crypto/PublicKey/RSA.py b/lib/Crypto/PublicKey/RSA.py
+index 99d851d..ec04625 100644
+--- a/lib/Crypto/PublicKey/RSA.py
++++ b/lib/Crypto/PublicKey/RSA.py
+@@ -348,9 +348,9 @@ class _RSAobj(pubkey.pubkey):
+                nb = long_to_bytes(self.n)
+                if bord(eb[0]) & 0x80: eb=bchr(0x00)+eb
+                if bord(nb[0]) & 0x80: nb=bchr(0x00)+nb
+-               keyparts = [ 'ssh-rsa', eb, nb ]
+-               keystring = ''.join([ struct.pack(">I",len(kp))+kp for kp in keyparts]) 
+-               return 'ssh-rsa '+binascii.b2a_base64(keystring)[:-1]
++               keyparts = [ b('ssh-rsa'), eb, nb ]
++               keystring = b('').join([ struct.pack(">I",len(kp))+kp for kp in keyparts])
++               return b('ssh-rsa ')+binascii.b2a_base64(keystring)[:-1]
+ 
+         # DER format is always used, even in case of PEM, which simply
+         # encodes it into BASE64.
+diff --git a/lib/Crypto/SelfTest/PublicKey/test_importKey.py b/lib/Crypto/SelfTest/PublicKey/test_importKey.py
+index f7c1edc..0e41577 100644
+--- a/lib/Crypto/SelfTest/PublicKey/test_importKey.py
++++ b/lib/Crypto/SelfTest/PublicKey/test_importKey.py
+@@ -104,7 +104,7 @@ Lr7UkvEtFrRhDDKMtuIIq19FrL4pUIMymPMSLBn3hJLe30Dw48GQM4UCAwEAAQ==
+ -----END PUBLIC KEY-----'''
+ 
+     # Obtained using 'ssh-keygen -i -m PKCS8 -f rsaPublicKeyPEM'
+-    rsaPublicKeyOpenSSH = '''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQC/HieQCqCLI1EaXBKBrm2TMSw+/pE/ky6+1JLxLRa0YQwyjLbiCKtfRay+KVCDMpjzEiwZ94SS3t9A8OPBkDOF comment\n'''
++    rsaPublicKeyOpenSSH = b('''ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAQQC/HieQCqCLI1EaXBKBrm2TMSw+/pE/ky6+1JLxLRa0YQwyjLbiCKtfRay+KVCDMpjzEiwZ94SS3t9A8OPBkDOF comment\n''')
+ 
+     # The private key, in PKCS#1 format encoded with DER
+     rsaKeyDER = a2b_hex(


Property changes on: packages/python-crypto/trunk/debian/patches/fix-py3-errors.patch
___________________________________________________________________
Added: svn:keywords
   + Id

Modified: packages/python-crypto/trunk/debian/patches/series
===================================================================
--- packages/python-crypto/trunk/debian/patches/series	2012-05-28 13:10:17 UTC (rev 21969)
+++ packages/python-crypto/trunk/debian/patches/series	2012-05-28 16:40:19 UTC (rev 21970)
@@ -3,3 +3,5 @@
 fix-epydoc-ignore.patch
 fix-cipher-iv-documentation.patch
 reenable-redefined-tests.patch
+fix-py3-errors.patch
+fix-except-shadows-builtin.patch




More information about the Python-modules-commits mailing list