Daniel Holth avatar Daniel Holth committed 02fd1a2

'wheel sign' fixes for Python 3

Comments (0)

Files changed (3)

 - 'wheel sign' uses the keys generated by 'wheel keygen' (instead of generating
   a new key at random each time)
 - Python 2/3 encoding/decoding fixes
+- Run tests on Python 2.6 (without signature verification)
 
 0.9
 ===
     def load(self):
         # XXX JSON is not a great database
         for path in dirspec.basedir.load_config_paths('wheel'):
-            conf = os.path.join(path, 'wheel.json')
+            conf = os.path.join(native(path), 'wheel.json')
             if os.path.exists(conf):
                 with open(conf, 'r') as infile:
                     self.data = json.load(infile)
     def add_signer(self, scope, vk):
         """Remember verifying key vk as being valid for signing in scope."""
         self.data['signers'].append({'scope':scope, 'vk':vk})
-    
+    

wheel/tool/__init__.py

     
     name = wf.parsed_filename.group('name')
     sign_with = wk.signers(name)[0]
-    vk = binary(sign_with[1])
     sys.stdout.write("Signing {0} with {1}\n".format(name, sign_with[1]))
     
-    sk = binary(keyring.get_keyring().get_password('wheel', vk))
-    keypair = ed25519ll.Keypair(urlsafe_b64decode(vk), urlsafe_b64decode(sk))
+    vk = sign_with[1]
+    kr = keyring.get_keyring()
+    sk = kr.get_password('wheel', vk)
+    keypair = ed25519ll.Keypair(urlsafe_b64decode(binary(vk)), 
+                                urlsafe_b64decode(binary(sk)))
+    
     
     record_name = wf.distinfo_name + '/RECORD'
     sig_name = wf.distinfo_name + '/RECORD.jws'
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.