koodaamo / tnefparse

a TNEF decoding library written in python, without external dependencies
GNU Lesser General Public License v3.0
49 stars 37 forks source link

Bug Fix #4

Closed idiom closed 11 years ago

idiom commented 11 years ago

I've removed the line: length = ord(offset[0]) + (ord(offset[1]) << 8)... as it throws a type error.

TypeError: 'int' object has no attribute 'getitem'

This could be changed to ord(data[offset:offset+4][0]) or create a temp var to parse through, but the original implementation using bytes_to_int looks cleaner.

Once I have some time I'll look at the performance gains cited in the original fix and add a few samples in tests.