Skip to content

Commit

Permalink
fixed 'tuple' object has no attribute 'week'
Browse files Browse the repository at this point in the history
  • Loading branch information
marzer committed Jun 14, 2024
1 parent c61af90 commit 7bcda66
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions src/poxy/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/poxy/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.17.0
0.17.1

0 comments on commit 7bcda66

Please sign in to comment.