Title mb makehashes doesn't work with very old Python
Priority bug Status resolved
Superseder Nosy List poeml
Assigned To poeml Keywords

Created on 2011-03-02.20:25:22 by poeml, last changed by poeml.

msg326 (view) Author: poeml Date: 2011-03-02.20:25:21
mb makehashes fails on SUSE SLES10, where SHA256 is not available. 

The following patch should fix this:

Index: mb/mb/
--- mb/mb/	(revision 8239)
+++ mb/mb/	(working copy)
@@ -455,7 +455,7 @@
                  '12:piece length', 'i', str(self.chunk_size), 'e',
                  '6:pieces', str(len(self.pieces) * SHA1_DIGESTSIZE), ':', 
                  '4:sha1', str(SHA1_DIGESTSIZE), ':', self.sha1,
-                 '6:sha256', str(SHA256_DIGESTSIZE), ':', self.sha256,
+                 '6:sha256', str(SHA256_DIGESTSIZE), ':', self.sha256 or '',
         h = sha1.sha1()
msg327 (view) Author: poeml Date: 2011-03-02.20:25:55
backtrace was:

  File "/usr/bin/mb", line 1638, in ?
    r = mirrordoctor.main()
  File "/usr/lib64/python2.4/site-packages/", line 257, in main
    return self.cmd(args)
  File "/usr/lib64/python2.4/site-packages/", line 280, in cmd
    retval = self.onecmd(argv)
  File "/usr/lib64/python2.4/site-packages/", line 412, in onecmd
    return self._dispatch_cmd(handler, argv)
  File "/usr/lib64/python2.4/site-packages/", line 1100, in 
    return handler(argv[0], opts, *args)
  File "/usr/bin/mb", line 1101, in do_makehashes
  File "/usr/lib64/python2.4/site-packages/mb/", line 90, in check_file
  File "/usr/lib64/python2.4/site-packages/mb/", line 311, in fill
  File "/usr/lib64/python2.4/site-packages/mb/", line 462, in calc_btih
TypeError: sequence item 28: expected string, NoneType found
msg328 (view) Author: poeml Date: 2011-03-02.20:27:40
proposed fix in trunk:
msg348 (view) Author: poeml Date: 2012-02-20.23:59:57
In 2.16.0.
Date User Action Args
2012-02-20 23:59:57poemlsetstatus: testing -> resolved
messages: + msg348
2011-03-02 20:27:40poemlsetmessages: + msg328
2011-03-02 20:25:55poemlsetmessages: + msg327
2011-03-02 20:25:22poemlcreate