projects
/
edward.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f4eb9a8
)
don't crash if a byte string can't be decoded
author
Andrew Engelbrecht
<sudoman@ninthfloor.org>
Tue, 21 Jul 2015 17:23:28 +0000
(13:23 -0400)
committer
Andrew Engelbrecht
<sudoman@ninthfloor.org>
Mon, 7 Dec 2015 18:28:38 +0000
(13:28 -0500)
edward
patch
|
blob
|
blame
|
history
diff --git
a/edward
b/edward
index e706c469e826ac1f3042ff806b43491f0d2dbca9..8f373a4ef1e3f577822c2cfd96ef51384ec9caec 100755
(executable)
--- a/
edward
+++ b/
edward
@@
-210,12
+210,14
@@
def get_subpart_data (part):
obj.charset = 'utf-8'
if obj.payload_bytes != None:
- # this belongs in a specific try statement.
- payload = PayloadPiece()
- payload.string = obj.payload_bytes.decode(obj.charset)
- payload.piece_type = 'text'
+ try:
+
payload = PayloadPiece()
+
payload.string = obj.payload_bytes.decode(obj.charset)
+
payload.piece_type = 'text'
- obj.payload_pieces = [payload]
+ obj.payload_pieces = [payload]
+ except UnicodeDecodeError:
+ pass
return obj