Question about `save_virtual_workbook` deprecation

Issue #1239 closed
Oleg Nykolyn
created an issue

Hi,

save_virtual_workbook() has been re-implmented and deprecated in 2.6.0 with recommendation to use NamedTemporaryFile: https://bitbucket.org/openpyxl/openpyxl/commits/d71d1885cea7e7ec939ace80efb20e8a554ae74d https://bitbucket.org/openpyxl/openpyxl/commits/2c8045bc3abf6a637f9f93400d8e0f603506a133

I haven't found any more details, just a code change. Could you please provide more info on these changes ? In-memory workbook is a very useful feature for unit-testing and generating files directly to S3, etc. New implementation uses real TemporaryFile, for some reason even without with statement. API usage with NamedTemporaryFile will be less clear and probably will be worse performance-wise, compared to old save_virtual_workbook() implementation.

Comments (2)

  1. CharlieC

    Questions should really be asked on the mailing list.

    The main reason is that the code is a lot simpler for openpyxl as it uses temporary files internally.

  2. Log in to comment