From 2d97dcf2506fcb1c04ae4f009e99a33b3f7d0e22 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 13 Aug 2022 17:32:36 +0200 Subject: [PATCH] get rid of dateutil --- requirements.d/development.lock.txt | 1 - requirements.d/development.txt | 1 - src/borg/testsuite/archiver.py | 5 ++--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/requirements.d/development.lock.txt b/requirements.d/development.lock.txt index 55a51cdea..24037f4ea 100644 --- a/requirements.d/development.lock.txt +++ b/requirements.d/development.lock.txt @@ -10,4 +10,3 @@ pytest-xdist==3.5.0 pytest-cov==4.1.0 pytest-benchmark==4.0.0 Cython==3.0.7 -python-dateutil==2.8.2 diff --git a/requirements.d/development.txt b/requirements.d/development.txt index 309bd72e6..23c7090ba 100644 --- a/requirements.d/development.txt +++ b/requirements.d/development.txt @@ -10,5 +10,4 @@ pytest-xdist pytest-cov pytest-benchmark Cython -python-dateutil pre-commit diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index 8cc930b6f..c1ae3c218 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -1,5 +1,4 @@ import argparse -import dateutil.tz import errno import io import json @@ -2207,8 +2206,8 @@ class ArchiverTestCase(ArchiverTestCaseBase): # Given a date and time in local tz, create a UTC timestamp string suitable # for create --timestamp command line option def _to_utc_timestamp(self, year, month, day, hour, minute, second): - dtime = datetime(year, month, day, hour, minute, second, 0, dateutil.tz.gettz()) - return dtime.astimezone(dateutil.tz.UTC).strftime("%Y-%m-%dT%H:%M:%S") + dtime = datetime(year, month, day, hour, minute, second, 0).astimezone() # local time with local timezone + return dtime.astimezone(timezone.utc).strftime("%Y-%m-%dT%H:%M:%S") def _create_archive_ts(self, name, y, m, d, H=0, M=0, S=0): loc = self.repository_location + '::' + name