[Git][reproducible-builds/diffoscope][master] 2 commits: Add a bit of space here.

Chris Lamb gitlab at salsa.debian.org
Wed Feb 17 12:40:36 UTC 2021



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
c4674ae9 by Chris Lamb at 2021-02-17T12:10:29+00:00
Add a bit of space here.

Gbp-Dch: ignore

- - - - -
6913a10e by Chris Lamb at 2021-02-17T12:40:14+00:00
Fix tempfile/weakref handling in Python 3.7 (ie. Debian buster). (Closes: reproducible-builds/diffoscope#239)

- - - - -


1 changed file:

- diffoscope/tempfiles.py


Changes:

=====================================
diffoscope/tempfiles.py
=====================================
@@ -85,9 +85,23 @@ def clean_all_temp_files():
 
         shutil.rmtree(_BASEDIR.name, ignore_errors=True)
 
+    if sys.version_info < (3, 8):
+        # Some change in tempfile or weakref handling happened after Python
+        # 3.7, resulting in us trying to delete our temporary files multiple
+        # times. Unfortunately, the cleanup for TemporaryDirectory does not set
+        # "ignore_errors", so we do that here.
+        import tempfile
+
+        def _rmtree(*args, **kwargs):
+            kwargs.setdefault("ignore_errors", True)
+            return shutil.rmtree(*args, **kwargs)
+
+        tempfile._rmtree = _rmtree
+
 
 def _get_base_temporary_directory():
     global _BASEDIR
+
     if _BASEDIR is None or not os.path.exists(_BASEDIR.name):
         try:
             # Try and generate a potentially-useful suffix to our temporary directory



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/8fd4b6ae82020d6c53d92e561fb73b0c960734a9...6913a10e9a90a95a61d6f06bd763dfe2e9a5918c

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/8fd4b6ae82020d6c53d92e561fb73b0c960734a9...6913a10e9a90a95a61d6f06bd763dfe2e9a5918c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20210217/1ffe37e3/attachment.htm>


More information about the rb-commits mailing list