cannot open workbooks generated with python 2.6.x on windows

Issue #282 resolved
Eric Gazoni
created an issue

Since the namespace changes (I think) I'm having trouble opening workbooks generated by openpyxl with python 2.6, but it works fine on python 2.7.

This only occurs on Windows as far as I know, I attached workbooks generated on the same machine, with the same version of openpyxl (1.8.3) using different python versions. You can clearly see a difference in generated XML between 2.6.x and 2.7.

Comments (11)

  1. Charlie Clark

    When you say "you can clearly see" I think you mean "in workbook.xml you can clearly see". It looks like the namespace registration isn't working as expected - this doesn't exist in ElementTree in Python 2.6. The error should occur on all platforms. Can you confirm that this is where it's happening by installing a more recent version of LXML on that machine?

  2. Charlie Clark

    I think the problem is quite simply that our version of register_namespace has never actually registered any namespaces with whichever version of ElementTree is in use.

  3. Eric Gazoni reporter

    I reproduce under linux too now. That's weird, didn't have issues before the namespace changes. I'm still trying to have LXML installed on the machine to confirm the bug.

  4. Charlie Clark

    hm, the fix itself is easy enough! It looks like Fredrik's suggestion was never properly done - it just assigns namespaces to module local! The hard part was working out how to test as the nolxml-py26 profile which is designed for this does not work properly in 1.8!

  5. Log in to comment