From 26cc85806ec971d5a27a44d9c20d877f44222125 Mon Sep 17 00:00:00 2001 From: jack1142 <6032823+jack1142@users.noreply.github.com> Date: Wed, 28 Aug 2019 04:01:02 +0200 Subject: [PATCH] [Utils] Stop using `:` in backup's filename - Windows doesn't accept it (#2957) --- changelog.d/2954.bugfix.rst | 1 + redbot/core/utils/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/2954.bugfix.rst diff --git a/changelog.d/2954.bugfix.rst b/changelog.d/2954.bugfix.rst new file mode 100644 index 000000000..e5e1c53cc --- /dev/null +++ b/changelog.d/2954.bugfix.rst @@ -0,0 +1 @@ +Stop using `:` character in backup's filename - Windows doesn't accept it \ No newline at end of file diff --git a/redbot/core/utils/__init__.py b/redbot/core/utils/__init__.py index 96a44c515..c97f7ac45 100644 --- a/redbot/core/utils/__init__.py +++ b/redbot/core/utils/__init__.py @@ -410,7 +410,7 @@ async def create_backup(dest: Path = Path.home()) -> Optional[Path]: return dest.mkdir(parents=True, exist_ok=True) - timestr = datetime.utcnow().isoformat(timespec="minutes") + timestr = datetime.utcnow().strftime("%Y-%m-%dT%H-%M-%S") backup_fpath = dest / f"redv3_{data_manager.instance_name}_{timestr}.tar.gz" to_backup = []