Shortened heading text for unallocated projects with capacity to avoi… #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a proposed minor bug-fix arising from something I noticed when informally helping someone install/use this excellent software on Windows.
The execution log (Windows and Linux) reports the following warning (in both test and real scenarios):
...openpyxl/workbook/child.py:99: UserWarning: Title is more than 31 characters. Some applications may not be able to read the file warnings.warn("Title is more than 31 characters. Some applications may not be able to read the file")
Whilst this doesn't cause LibreOffice Calc on Linux any problems (it just opens the result file as-created), when using Excel O365 on Windows and attempting to open the result file, an error dialog is shown:
We found a problem with some content in
<file>
. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes.If one clicks "Yes", another dialog appears:
Repairs to
<file>
: Excel was able to open the file by repairing or removing unreadable content. Repaired Records: Worksheet properties from /xl/workbool.xml part (Workbook).The resulting Excel sheet is then shown with the worksheet title Unallocated_projects_with_capacity truncated to Unallocated_projects_with_capac.
I have shortened the title in
constants.py
to less than 31 characters (Unalloc_projects_with_capacity). This eliminates both the execution log warning and the Excel corruption/repair sequence (tested on the ten test scenarios in the package).Using a lightly-adapted (to allow the differently named worksheets to be compared) version of this xslx diff approach, I have checked that the remainder of the file contents from the revised version match those arising from the current master branch (aside from the run timestamp which differs as expected) in each of the ten test cases.