diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ffaf1d..34e8014 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## v0.17.1 - 2024-06-14 + +- Fixed `'tuple' object has no attribute 'week'` error on Python <= 3.8 + ## v0.17.0 - 2024-04-21 - added arguments `--min-version` and `--squash-patches` for more control over `--git-tags` mode diff --git a/src/poxy/project.py b/src/poxy/project.py index 53996c3..53ed9eb 100644 --- a/src/poxy/project.py +++ b/src/poxy/project.py @@ -7,6 +7,7 @@ Everything relating to the 'project context' object that describes the project for which the documentation is being generated. """ +import sys import copy import os @@ -1222,7 +1223,10 @@ def __init__( html_exclude = re.compile(str(html_exclude)) self.html_exclude = html_exclude - self.now = datetime.datetime.utcnow().replace(microsecond=0, tzinfo=datetime.timezone.utc) + if (sys.version_info[0], sys.version_info[1]) >= (3, 11): + self.now = datetime.datetime.now(datetime.UTC).replace(microsecond=0) + else: + self.now = datetime.datetime.utcnow().replace(microsecond=0, tzinfo=datetime.timezone.utc) self.verbose_value(r'dirs.PACKAGE', paths.PACKAGE) self.verbose_value(r'dirs.CSS', paths.CSS) @@ -1657,7 +1661,7 @@ def add_internal_asset(p) -> str: if source and dest: if is_uri(source): file = Path( - paths.TEMP, rf'tagfile_{sha1(source)}_{self.now.year}_{self.now.isocalendar().week}.xml' + paths.TEMP, rf'tagfile_{sha1(source)}_{self.now.year}_{self.now.isocalendar()[1]}.xml' ) self.tagfiles[source] = (file, dest) self.unresolved_tagfiles = True diff --git a/src/poxy/version.txt b/src/poxy/version.txt index c5523bd..7cca771 100644 --- a/src/poxy/version.txt +++ b/src/poxy/version.txt @@ -1 +1 @@ -0.17.0 +0.17.1