def _get_system_tz(self):
if not HAS_PYTZ:<EOL><INDENT>return None<EOL><DEDENT>def _etc_localtime():<EOL><INDENT>try:<EOL><INDENT>with open('<STR_LIT>', '<STR_LIT:rb>') as fp:<EOL><INDENT>return pytz.tzfile.build_tzinfo('<STR_LIT>', fp)<EOL><DEDENT><DEDENT>except OSError as exc:<EOL><INDENT>if exc.errno != errno.ENOENT:<EOL><INDENT>self.logger.error(<EOL>'<STR_LIT>', exc.strerror<EOL>)<EOL><DEDENT><DEDENT>except pytz.UnknownTimeZoneError:<EOL><INDENT>self.logger.error(<EOL>'<STR_LIT>'<EOL>)<EOL><DEDENT>return None<EOL><DEDENT>def _etc_timezone():<EOL><INDENT>try:<EOL><INDENT>with open('<STR_LIT>', '<STR_LIT:r>') as fp:<EOL><INDENT>tzname = fp.read().strip()<EOL><DEDENT>return pytz.timezone(tzname)<EOL><DEDENT>except OSError as exc:<EOL><INDENT>if exc.errno != errno.ENOENT:<EOL><INDENT>self.logger.error(<EOL>'<STR_LIT>', exc.strerror<EOL>)<EOL><DEDENT><DEDENT>except pytz.UnknownTimeZoneError:<EOL><INDENT>self.logger.error(<EOL>'<STR_LIT>',<EOL>tzname<EOL>)<EOL><DEDENT>return None<EOL><DEDENT>return _etc_localtime() or _etc_timezone()<EOL>
Get the system timezone for use when no timezone is explicitly provided

Requires pytz, if not available then no timezone will be set when not
explicitly provided.