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

gh-58451: Add optional delete_on_close parameter to NamedTemporaryFile #97015

Merged
merged 26 commits into from Oct 4, 2022

Commits on Sep 21, 2022

Commits on Sep 22, 2022

  1. Based on the review from @eryksun the code and the documentation is u…

    …pdated to handle the situation, when delete = True, delete_on_close = Flase and no context manager was used
    Ev2geny committed Sep 22, 2022
  2. minor documentation update

    Ev2geny committed Sep 22, 2022
  3. Update Doc/whatsnew/3.12.rst

    Co-authored-by: Éric <merwok@netwok.org>
    Ev2geny and merwok committed Sep 22, 2022

Commits on Sep 23, 2022

  1. Deletion of file upon finalization is moved from _TemporaryFileWrappe…

    …r to _TemporaryFileCloser
    
    Test test_del_by_finalizer_if_no_with is changed from simulating finalizer by calling __del__() to making
    sure finalizer really runs
    Ev2geny committed Sep 23, 2022

Commits on Sep 24, 2022

  1. clearing of the files in the situation when delete and not delete_on_…

    …close is moved to _TemporaryFileWrapper
    
    based on the advice from @eryksun
    
    There are errors in the test (at least on Linux)
    Ev2geny committed Sep 24, 2022
  2. if statement is added to avoid errors, when testing. Not sure 100% is…

    … this is a solution or workaround
    Ev2geny committed Sep 24, 2022

Commits on Sep 25, 2022

  1. Apply suggestions from code review

    Implemented review from @eryksun and @merwok
    
    Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
    Co-authored-by: Eryk Sun <eryksun@gmail.com>
    Co-authored-by: Éric <merwok@netwok.org>
    4 people committed Sep 25, 2022
  2. _TemporaryFileCloser is returned to original state and the logic, whi…

    …ch takes into account delete_on_close moved to _TemporaryFileWrapper (suggestion of @ekisun)
    Ev2geny committed Sep 25, 2022
  3. All delete operations are moved to the class _TemporaryFileCloser

    	modified:   Lib/tempfile.py
    Ev2geny committed Sep 25, 2022
  4. Minor update to comments

    Ev2geny committed Sep 25, 2022
  5. Whitespec fixes by patchcheck.py

    	modified:   Lib/tempfile.py
    Ev2geny committed Sep 25, 2022

Commits on Sep 26, 2022

  1. Update Lib/tempfile.py

    Co-authored-by: Eryk Sun <eryksun@gmail.com>
    Ev2geny and eryksun committed Sep 26, 2022
  2. Update Lib/tempfile.py

    Co-authored-by: Eryk Sun <eryksun@gmail.com>
    Ev2geny and eryksun committed Sep 26, 2022
  3. Modified exception handling in NamedTemporaryFile

    	modified:   Lib/tempfile.py
    Ev2geny committed Sep 26, 2022
  4. Wrapping at 80 characters is fixed

    	modified:   Lib/test/test_tempfile.py
    Ev2geny committed Sep 26, 2022

Commits on Oct 1, 2022

  1. Update Lib/tempfile.py

    Co-authored-by: Eryk Sun <eryksun@gmail.com>
    Ev2geny and eryksun committed Oct 1, 2022
  2. Documentation update, based on the feedback from @zooba

    	modified:   Doc/library/tempfile.rst
    Ev2geny committed Oct 1, 2022
  3. Minor PEP8 update based on the feedback from @zooba

    	modified:   Lib/test/test_tempfile.py
    Ev2geny committed Oct 1, 2022
  4. Improving comments in the init test file, based on the feedback from @…

    …eryksun
    
    
    Files changed:
          Lib/test/test_tempfile.py
    
    Co-authored-by: Eryk Sun <eryksun@gmail.com>
    Ev2geny and eryksun committed Oct 1, 2022

Commits on Oct 2, 2022

  1. Updating of documentation

    	modified:   library/tempfile.rst
    Ev2geny committed Oct 2, 2022
  2. Merge branch 'fix-issue-14243' of https://github.com/Ev2geny/cpython

    …into fix-issue-14243
    Ev2geny committed Oct 2, 2022

Commits on Oct 4, 2022