jmcnamara / XlsxWriter

A Python module for creating Excel XLSX files.
https://xlsxwriter.readthedocs.io
BSD 2-Clause "Simplified" License
3.61k stars 629 forks source link

feature request: Add a clearer error message, if the datatype for the sheetname is incorrect. #1063

Closed fwitte closed 5 months ago

fwitte commented 5 months ago

Feature Request

From time to time I teach python beginners on how to write data from pandas to excel. Quite often they happen to provide a sheetname that is of type int. The errormessage shown, i.e. that a int type variable has no len might be clear for experienced users, but might be difficult to understand for beginners. Therefore, I opened a mini PR, introducing a type check and a clear error message for wrong type sheetnames.

jmcnamara commented 5 months ago

Thanks for the suggestion.

However I don't think this is a common enough error to merit its own exception so I will pass on the PR.