Browse code

* S3/Exceptions.py: Correct S3Exception.__str__() to avoid crash in S3Error() subclass. Reported by '~t2~'. * NEWS: Updated.

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

Michal Ludvig authored on 2009/01/31 21:18:25
Showing 3 changed files
... ...
@@ -1,3 +1,9 @@
1
+2009-02-01  Michal Ludvig  <michal@logix.cz>
2
+
3
+	* S3/Exceptions.py: Correct S3Exception.__str__() to
4
+	  avoid crash in S3Error() subclass. Reported by '~t2~'.
5
+	* NEWS: Updated.
6
+
1 7
 2009-01-30  Michal Ludvig  <michal@logix.cz>
2 8
 
3 9
 	* Released version 0.9.9-rc2
... ...
@@ -1,3 +1,8 @@
1
+s3cmd 0.9.9-rc2  - ?
2
+===============
3
+* Fixed crash in S3Error().__str__() (typically Amazon's Internal
4
+  errors, etc).
5
+
1 6
 s3cmd 0.9.9-rc2  - 2009-01-30
2 7
 ===============
3 8
 * Fixed s3cmd crash when put / get / sync found
... ...
@@ -16,7 +16,9 @@ class S3Exception(Exception):
16 16
 		self.message = unicodise(message)
17 17
 
18 18
 	def __str__(self):
19
-		return deunicodise(self.message)
19
+		## Call unicode(self) instead of self.message because
20
+		## __unicode__() method could be overriden in subclasses!
21
+		return deunicodise(unicode(self))
20 22
 
21 23
 	def __unicode__(self):
22 24
 		return self.message