ValueError when using .rows on sheet with hyperlinks
I have a workbook containing a worksheet with hyperlinks. When loading the workbook (use_iterators=True and data_only=True) and reading rows of sheet called "Modification Summary", I get a ValueError.
Comments (13)
-
-
-
looked at the issue, it's because we assume that a formula always gives back a numerical value, while it could (in this case) be a link with no "cache" to cast to int/float. I'm working on a fix, just have to figure out how to correct the assumption without breaking something else in the process ;-)
-
- changed version to 2.1.x
-
-
assigned issue to
-
assigned issue to
-
@Eric Gazoni in such cases it should probably return None.
It's worth noting that this file cannot be validated.
-
Standard cells use a regex to check for numerical values in such cases. This can probably be added to the the ReadOnlyCell as
el.FindText('v')
will always return an empty string for empty tags and onlyNone
if there is no such tag. -
- changed status to resolved
Merged in ericgazoni/openpyxl-328/2.1 (pull request #28)
when reading a sheet with data_only, containing an hyperlink but no cache value, do not try to force it as a numerical value, just return None (fixes
#328)→ <<cset 8dbd1b3dea3c>>
-
when reading a sheet with data_only, containing an hyperlink but no cache value, do not try to force it as a numerical value, just return None (fixes
#328)→ <<cset d1e1ea5bcb2f>>
-
in data only mode, when reading an empty cell with no type, force value to be None (fixes
#328)→ <<cset 6512e1702db1>>
-
Merged in ericgazoni/openpyxl-328/2.1 (pull request #28)
when reading a sheet with data_only, containing an hyperlink but no cache value, do not try to force it as a numerical value, just return None (fixes
#328)→ <<cset 8dbd1b3dea3c>>
-
- removed version
Removing version: 2.1.x (automated comment)
-
- removed component
Removing component: reader (automated comment)
- Log in to comment
I can confirm this with the following code:
The traceback is
Doesn't happen with when not read_only.