Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

TypeError: must be str, not bytes in ppt_parser.decompressor.decompress #607

Closed
jloehel opened this issue Sep 9, 2020 · 3 comments · Fixed by #450
Closed

TypeError: must be str, not bytes in ppt_parser.decompressor.decompress #607

jloehel opened this issue Sep 9, 2020 · 3 comments · Fixed by #450

Comments

@jloehel
Copy link
Contributor

jloehel commented Sep 9, 2020

decomp = ''

I guess this should be:

decomp = b''

Traceback:

Traceback (most recent call last):
...
  File "/home/jloehel/projects/github.com/**/**/.venv/lib64/python3.6/site-packages/oletools/olevba.py", line 2704, in __init__
    self.open_ppt()
  File "/home/jloehel/projects/github.com/**/**/.venv/lib64/python3.6/site-packages/oletools/olevba.py", line 3018, in open_ppt
    for vba_data in ppt.iter_vba_data():
  File "/home/jloehel/projects/github.com/**/**/.venv/lib64/python3.6/site-packages/oletools/ppt_parser.py", line 1147, in wrapped
    for result in func(self, self._open_main_stream, *args, **kwargs):
  File "/home/jloehel/projects/github.com/**/**/.venv/lib64/python3.6/site-packages/oletools/ppt_parser.py", line 1604, in iter_vba_data
    yield self.decompress_vba_storage(storage)
  File "/home/jloehel/projects/github.com/**/**/.venv/lib64/python3.6/site-packages/oletools/ppt_parser.py", line 1114, in wrapped
    return func(self, self._open_main_stream, *args, **kwargs)
  File "/home/jloehel/projects/github.com/**/**/.venv/lib64/python3.6/site-packages/oletools/ppt_parser.py", line 1555, in decompress_vba_storage
    iterative_decompress(stream, storage.data_size)
  File "/home/jloehel/projects/github.com/**/**/.venv/lib64/python3.6/site-packages/oletools/ppt_parser.py", line 1624, in iterative_decompress
    decomp += decompressor.decompress(stream.read(n_new))
TypeError: must be str, not bytes
@jloehel
Copy link
Contributor Author

jloehel commented Sep 9, 2020

This is the same issue: #177 There is also already a PR open for this: #450. @decalage2 Any chance to get this merged soon? :-)

@decalage2 decalage2 linked a pull request Sep 10, 2020 that will close this issue
@decalage2
Copy link
Owner

I just merged PR #450 and now it works on the few PPT samples I tested.
@jloehel could you please confirm it solves the issue on your side?

@jloehel
Copy link
Contributor Author

jloehel commented Sep 10, 2020

I just merged PR #450 and now it works on the few PPT samples I tested.
@jloehel could you please confirm it solves the issue on your side?

Thanks for the quick response. It works fine now. :-) I can parse now the most of the samples. I experience more issues with PPT samples but I will report them in separated issues.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants