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

decode_mapi exception #13

Closed dgouldin closed 6 years ago

dgouldin commented 7 years ago

When using decode_mapi, I get the following error with the logger level set to DEBUG:

'int' object has no attribute '__getitem__'

After poking at the source to prevent it swallowing the stack trace of the error, it looks as though it's coming from:

https://github.com/koodaamo/tnefparse/blob/137e7d23a3bfa80296504c4f41f9b1471d686b96/tnefparse/mapi.py#L81

(That makes sense to me, given that offset is an int.)

Apologies, I don't know the subject matter well enough to propose a fix.

petri commented 7 years ago

Can you share the TNEF file you are using that produces this logger debug error?

nikiladonya commented 6 years ago

@petri Hello, file called "two-files.tnef" in your tests raise this error (3 python)

petri commented 6 years ago

@nikiladonya can you provide an example piece of code to raise the error?

petri commented 6 years ago

This should now be fixed in master.

petri commented 6 years ago

By the way, the debug code is really old and should be cleaned. It is very possible that setting log level to DEBUG exposes some bugs in debugging parts of the code itself. If you find an issue that is an actual problem for you, please submit a new issue.