Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

FIX: fixed isOleFile issue when passing small buffer. #2246

Closed
wants to merge 1 commit into from

Conversation

Nazarii
Copy link

@Nazarii Nazarii commented Nov 22, 2016

Fixes # .
Fixed file() argument 1 must be encoded string without NULL bytes, not str
Changes proposed in this pull request:

When calling isOleFile('Hello there') we will receive an error as method determines argument as a file but should return False instead of raising an error.
*
*
*

…AL_OLEFILE_SIZE

@hugovk hugovk added the olefile label Nov 22, 2016
@hugovk
Copy link
Member

hugovk commented Nov 22, 2016

@Nazarii This fails an existing test on Python 2.x:

TestOleFileIo.test_isOleFile ... FAIL
======================================================================
FAIL: TestOleFileIo.test_isOleFile
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/python-pillow/Pillow/Tests/test_olefileio.py", line 13, in test_isOleFile
    self.assertTrue(OleFileIO.isOleFile(ole_file))
AssertionError: False is not true

https://travis-ci.org/python-pillow/Pillow/jobs/178017768
https://travis-ci.org/python-pillow/Pillow/builds/178017763

This PR would also need a test which demonstrates the error, fails on current master and passes with your change.

However, we may be removing olefile from this repo, see #2199. Even if we don't, this would probably also have to go to the main repo, with tests: https://github.com/decalage2/olefile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants