Issue #7 resolved

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

chuckleberryfinn avatarchuckleberryfinn created an issue

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

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

should read:

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. chuckleberryfinn

    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

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.