I am running a python script that uses the cygwin registration module on Windows 7. The command datereports the correct time:
date
$ date Tue, Aug 14, 2012 2:47:49 PM
However, the python script shuts down after five hours:
2012-08-14 19:39:06,438: Done!
I do nothing when I configure logging for the script:
logging.basicConfig(format='%(asctime)-15s: %(message)s', level=logging.DEBUG)
Can someone tell me what is happening and how can I fix it?
You need to disable the "TZ" environment in your python script before importing date and time modules. It is set by cygwin but not understood by Windows:
if os.getenv("TZ"): os.unsetenv("TZ")
, TZ , Python Cygwin GMT (UTC). , TZ , Windows!
TZ
unset TZ bash Python, Python Windows. ENV Python , Python ( os.environ['TZ'] Python , , , import os , , "Cygwin/Python", UTC?).
unset TZ
os.environ['TZ']
os
, unset TZ .bash_profile ( /home/<user>, , Cygwin).
/home/<user>