Browse code

Fixed Python 2.4 after conversion to 'hashlib'

git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@324 830e0280-6d2a-0410-9c65-932aecc39d9d

W. Tell authored on 2008/12/31 21:57:19
Showing 3 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 2009-01-01  W. Tell  <w_tell -at- sourceforge>
2 2
 
3 3
 	* S3/S3.py, S3/Utils.py: Use 'hashlib' instead of md5 and sha 
4
-	  modules to avoid Python 2.6 warnings. 
4
+	  modules to avoid Python 2.6 warnings.
5 5
 
6 6
 2008-12-31  Michal Ludvig  <michal@logix.cz>
7 7
 
... ...
@@ -17,7 +17,7 @@ try:
17 17
 	from hashlib import md5, sha1
18 18
 except ImportError:
19 19
 	from md5 import md5
20
-	from sha import sha as sha1
20
+	import sha as sha1
21 21
 import hmac
22 22
 
23 23
 from Utils import *
... ...
@@ -768,14 +768,14 @@ def cmd_sync_local2remote(src, dst):
768 768
 				except KeyError:
769 769
 					attr = "uid"
770 770
 					val = st.st_uid
771
-					warning(u"%s: Owner username not known. Storing UID=%d instead." % (src, val))
771
+					warning(u"%s: Owner username not known. Storing UID=%d instead." % (unicodise(src), val))
772 772
 			elif attr == 'gname':
773 773
 				try:
774 774
 					val = grp.getgrgid(st.st_gid).gr_name
775 775
 				except KeyError:
776 776
 					attr = "gid"
777 777
 					val = st.st_gid
778
-					warning(u"%s: Owner groupname not known. Storing GID=%d instead." % (src, val))
778
+					warning(u"%s: Owner groupname not known. Storing GID=%d instead." % (unicodise(src), val))
779 779
 			else:
780 780
 				val = getattr(st, 'st_' + attr)
781 781
 			attrs[attr] = val