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

Use file object directly in temporary_config() #1598

Merged
merged 6 commits into from
Jun 21, 2024

Commits on Jun 17, 2024

  1. Fixed an error in the temporary_config() context manager.

    The context manager uses `NamedTemporaryFile` to store the current configuration, to later restore them.
    Instead of passing the file object directly to the save function, it just passes the file name, i.e. the save (and the load function) will open the file again, which is in itself not a problem.
    However, on the Github Windows image this leads to a permission error (using the created file object is fine).
    
    This commit solves this by adding the `file` argument to `Config.save()` that allows to pass a file object directly to the function.
    The same change is applied to the load function of the config object.
    philip-paul-mueller committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    f6da809 View commit details
    Browse the repository at this point in the history
  2. The default mode of NamedTemporaryFile() is w+b, however, since t…

    …he previous code repopened the file with `open()` that has `rt` the new file must also be opened that way.
    philip-paul-mueller committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    2d10a6e View commit details
    Browse the repository at this point in the history
  3. Fixed a bug.

    philip-paul-mueller committed Jun 17, 2024
    Configuration menu
    Copy the full SHA
    fefbd99 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5cfc2d4 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2024

  1. Configuration menu
    Copy the full SHA
    52acbe9 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2024

  1. Configuration menu
    Copy the full SHA
    561276c View commit details
    Browse the repository at this point in the history