Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in keyword passing in XLSXWriter.__init__() causes uncontrolled memory usage #12

Open
ShaheedHaque opened this issue Oct 6, 2021 · 0 comments

Comments

@ShaheedHaque
Copy link

The change to XLSXWriter.__init__() in bf0e271:

  • causes the intended defaults for constant_memory and default_date_format to be ignored
  • makes it impossible to provide overriding values for those defaults

because these two keywords arguments are not passed into the options passed to the underlying xlsxwriter.Workbook(). I think a fix like this is needed:

    def __init__(
        self,
        file_alike_object,
        file_type,
        constant_memory=True,
        default_date_format="dd/mm/yy",
        **keywords
    ):
        if "single_sheet_in_book" in keywords:
            keywords.pop("single_sheet_in_book")
        keywords['constant_memory'] = constant_memory             # <<< new line
        keywords['default_date_format'] = default_date_format     # <<< new line
        self.xlsx_book = xlsxwriter.Workbook(
            file_alike_object, options=keywords
        )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant