Issue #7 resolved

Bug in OleFileIO_PL.py, instance has no attribute '_unicode'

chuckleberryfinn
created an issue

I found a bug while testing some XLS samples: File "OleFileIO_PL.py", line 1543, in getproperties {{{

!python

value = self._unicode(s[offset+8:offset+8+count*2]) }}} should read: {{{

!python

value = _unicode(s[offset+8:offset+8+count*2]) }}}

The library works fine, and this is only a minor bug, but it would be better (for me ;) ) if it's fixed at source so I don't have to maintain the bug fix separate to new versions.

I noticed there has been no updates to this project since last year, is the project still in active development?

Comments (7)

  1. Philippe Lagadec repo owner

    Hello, thank you for reporting this bug with a fix. Would it be possible to provide a sample XLS file and also sample python code which triggers the bug, so that I can reproduce it myself? Thank you,

    Philippe.

  2. chuckleberryfinn reporter

    Hi Philippe,

    Many thanks for your prompt reply. I've attached an Excel file that will crash OLEFileIO_PL. It's a dummy file with a unicode value, "Tester", set for Author under the Document properties.

    The crash happens in the getproperties function, when the properties for the SummaryInformation substream are parsed. When the unicode value is encountered (1541: type == VT_LPWSTR) the script attempts to call:

    self._unicode(s[offset+8:offset+8+count*2])
    

    The _unicode function isn't defined inside the OleFileIO class so the crash occurs.

    You can reproduce the crash by calling:

    OleFileIO_PL.py CrashTest.xls

    or the following script:

    import OleFileIO_PL
    
    ole = OleFileIO_PL.OleFileIO(r'CrashTest.xls')
    ole.getproperties('\x05SummaryInformation')
    

    If you need any other information, don't hesitate to let me know.

    Kind Regards.

    C

  3. Log in to comment