[diffoscope] 01/01: set_locale should call tzset. (Closes: #848249)

Chris Lamb chris at chris-lamb.co.uk
Thu Dec 15 18:33:51 CET 2016


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository diffoscope.

commit a828cb782b36b183590ad4c7c60a3a0e43f41a07
Author: Brett Smith <brettcsmith at brettcsmith.org>
Date:   Thu Dec 15 12:14:42 2016 -0500

    set_locale should call tzset. (Closes: #848249)
    
    This is necessary to update timezone information for C code we've pulled in
    that might've already called it.  In particular, the python-magic libmagic
    wrapper can be affected by this, and print out gzip mtimes in the user's
    timezone.
    
    Signed-off-by: Chris Lamb <lamby at debian.org>
---
 diffoscope/__init__.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/diffoscope/__init__.py b/diffoscope/__init__.py
index b1bb1d4..827445f 100644
--- a/diffoscope/__init__.py
+++ b/diffoscope/__init__.py
@@ -23,6 +23,7 @@ import logging
 import platform
 import tempfile
 import functools
+import time
 
 from distutils.spawn import find_executable
 
@@ -90,6 +91,7 @@ def set_locale():
         os.environ[var] = 'C'
     os.environ['LC_CTYPE'] = 'C.UTF-8'
     os.environ['TZ'] = 'UTC'
+    time.tzset()
 
 
 temp_files = []

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git


More information about the diffoscope mailing list