mb makehashes doesn't work with very old Python #85

Closed
poeml opened this Issue Jun 5, 2015 · 0 comments

1 participant

@poeml
Owner
                                                                               [          ]

Issue migrated (2015-06-05) from old issue tracker http://mirrorbrain.org/issues/issue85

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

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/hashes.py

--- mb/mb/hashes.py (revision 8239)
+++ mb/mb/hashes.py (working copy)
@@ -455,7 +455,7 @@
'12:piece length', 'i', str(self.chunk_size), 'e',
'6:pieces', str(len(self.pieces) * SHA1_DIGESTSIZE), ':',
''.join(self.pieces),
'4:sha1', str(SHA1_DIGESTSIZE), ':', self.sha1,

  • '6:sha256', str(SHA256_DIGESTSIZE), ':', self.sha256,
  •             '6:sha256', str(SHA256_DIGESTSIZE), ':', self.sha256 or '',
              'e']
    
       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/cmdln.py", line 257, in main
  return self.cmd(args)
File "/usr/lib64/python2.4/site-packages/cmdln.py", line 280, in cmd
  retval = self.onecmd(argv)
File "/usr/lib64/python2.4/site-packages/cmdln.py", line 412, in onecmd
  return self._dispatch_cmd(handler, argv)
File "/usr/lib64/python2.4/site-packages/cmdln.py", line 1100, in

_dispatch_cmd
return handler(argv[0], opts, *args)
File "/usr/bin/mb", line 1101, in do_makehashes
copy_permissions=opts.copy_permissions)
File "/usr/lib64/python2.4/site-packages/mb/hashes.py", line 90, in check_file
self.hb.fill(verbose=verbose)
File "/usr/lib64/python2.4/site-packages/mb/hashes.py", line 311, in fill
self.calc_btih()
File "/usr/lib64/python2.4/site-packages/mb/hashes.py", line 462, in calc_btih
h.update(''.join(buf))
TypeError: sequence item 28: expected string, NoneType found

msg328 (view) Author: poeml Date: 2011-03-02.20:27:40

proposed fix in trunk:

http://svn.mirrorbrain.org/viewvc/mirrorbrain?view=revision&revision=8240

msg348 (view) Author: poeml Date: 2012-02-20.23:59:57

In 2.16.0.

History
         Date         User  Action            Args
2012-02-20 23:59:57 poeml set    status: testing -> resolved
                                   messages: + msg348
2011-03-02 20:27:40 poeml set    messages: + msg328
2011-03-02 20:25:55 poeml set    messages: + msg327
2011-03-02 20:25:22 poeml create

(end of migrated issue)
@poeml poeml added bug resolved labels Jun 5, 2015
@poeml poeml closed this Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment