Modify

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13269 closed defect (fixed)

Can't open an XLSX file.

Reported by: roger.oberholtzer@… Owned by: Daniel Rolls
Priority: normal Component: ExcelXlstViewerPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.2

Description

When I try to open an Excel sheet in Trac 1.2.2 with the current version of the plugin, I get this error:

Warning: HTML preview using ExcelXSLTRenderer failed (AttributeError: 'Worksheet' object has no attribute 'get_highest_row') 

Is there a minimum version of Excel for which this works?

Attachments (0)

Change History (5)

comment:1 Changed 7 years ago by Jun Omae

It seems get_highest_row method has been removed in openpyxl 2.4. See https://bitbucket.org/openpyxl/openpyxl/commits/39ce87a92a1ed4e48e452676248e479fc276c56c#chg-openpyxl/worksheet/worksheet.py.

However, return value of the sheet.get_highest_row() is not used. We could remove the line...?

  • excelxlstviewerplugin/0.11/tracexcelxlstviewer/__init__.py

    diff --git a/excelxlstviewerplugin/0.11/tracexcelxlstviewer/__init__.py b/excelxlstviewerplugin/0.11/tracexcelxlstviewer/__init__.py
    index 8d4c26aec..4a321d2e4 100644
    a b class ExcelXSLTRenderer(Component): 
    4949            continue # Skip empty sheet
    5050        buf.append(u'<table class="listing"><caption>%s</caption>\n' % escape(sheetName))
    5151            buf.append(u'<tbody>')
    52         sheet.get_highest_row()
    5352        rowIdx = 0
    5453        for row in sheet.range(sheet.calculate_dimension()):
    5554                buf.append(u'<tr class="%s">' % (rowIdx % 2 and 'odd' or 'even'))

comment:2 Changed 7 years ago by Ryan J Ollos

In 16798:

TracExcelXLSTViewer 0.9.3: Fix mixed tabs and spaces

Refs #13269.

comment:3 Changed 7 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

In 16799:

TracExcelXlstViewer 1.0dev: Make compatible with Trac 1.0+ and newer openpyxl

Be sure to uninstall the old plugin before installing this
version, as the entry point has been changed.

Fixes #13269.

comment:4 in reply to:  3 Changed 7 years ago by roger.oberholtzer@…

Replying to Ryan J Ollos:

Be sure to uninstall the old plugin before installing this version, as the entry point has been changed.

Hmmm. All this time I have been using Trac, and I have never uninstalled a plugin. I installed it via the setup.py in the plugin. How to uninstall? (I feel rather stupid asking!)

BTW, I do not use pip or easy_install because on openSUSE there seems to be an issue. I run Python 2.7 (to make Trac happy), but these at some point get confused and want to do some Python 3 stuff. So I use the plugin's setup.py to do the installs.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Daniel Rolls.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.