#2167 koji-web taskinfo page errors on open tasks on py2
Closed: Duplicate 4 years ago by tkopecek. Opened 4 years ago by ktdreyer.

My koji-web server is CentOS 7, running koji-web from EPEL (Python 2). When loading a taskinfo web page for a task that has not yet completed (eg. "OPEN"), we hit the following error:

AttributeError: 'datetime.datetime' object has no attribute 'timestamp'

The problem is in /usr/share/koji-web/scripts/taskinfo.chtml:

#set $end_ts = datetime.datetime.utcnow().timestamp()

The timestamp() method is new in Python 3.3. From https://stackoverflow.com/a/50650878 , I used this Python 2.7-compatible version like so:

#set $utcnow = datetime.datetime.utcnow()
#set $end_ts = ($utcnow - datetime.datetime(1970, 1, 1)).total_seconds()

I think this is already fixed in 1.21

Yes, it is a duplicate of #2076

Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue close_status updated to: Duplicate
- Issue status updated to: Closed (was: Open)

4 years ago

Sorry, I should have checked that :)

I've opened https://bugzilla.redhat.com/show_bug.cgi?id=1826406 to track the update in epel7.

Login to comment on this ticket.

Metadata