#231 Koji (koji-web) fails in Fedora 25 with DateTime instance has no attribute 'rfind'
Closed: Fixed Opened by amessina.

File "/usr/share/koji-web/scripts/wsgi_publisher.py", line 387, in handle_request
result = func(environ, **data)
File "/usr/share/koji-web/scripts/index.py", line 317, in index
return _genHTML(environ, 'index.chtml')
File "/usr/share/koji-web/lib/kojiweb/util.py", line 147, in _genHTML
return tmpl_inst.respond().encode('utf-8', 'replace')
File "index_chtml.py", line 151, in respond
File "/usr/lib/python2.7/site-packages/koji/__init__.py", line 2419, in formatTime
dotidx = value.rfind('.')
AttributeError: DateTime instance has no attribute 'rfind'

Related to #230

I wonder if this one and #230 are helped by this patch:

https://pagure.io/fork/mikeb/koji/c/676db88a8bd4c729278ef4594c9174be5b554b2f

I suppose I could git it a try if you're interested in merging it for the next release. Is that what you're wondering? ;)

@mikem, I can confirm that applying your patch https://pagure.io/fork/mikeb/koji/c/676db88a8bd4c729278ef4594c9174be5b554b2f (and removing PyGreSQL for good measure) resolves the issue on a Fedora 25 installation.

@mikem, I can confirm that applying your patch https://pagure.io/fork/mikeb/koji/c/676db88a8bd4c729278ef4594c9174be5b554b2f (and removing PyGreSQL for good measure) resolves the issue on a Fedora 25 installation.

Thanks!
That patch needs more testing, but I think it might be the way we need to go now. It looks like PyGreSQL introduced many incompatible changes in 5.0.

Reproducible for me as well, koji-web falis with this (and other) errors when talking to hub deployed on Fedora 25. Combination of hub/f24 and web/f25 works fine.

@mikem Are we going to fix these issues with PyGreSQL or migrate to psycopg2?

@mikem @tkopecek For what it's worth, I went ahead and applied the patch to migrate to psycopg2 downstream in the Koji package for Mageia.

I've tested the psycopg2 patch from @mikeb (rebased to 1.11.0 by @ngompa) and it fixes the problem on Fedora 25.

There may be some corner issues with the psychopg2 patch, so beware

I've opened PR #240 for discussion about psycopg2 solution.

Commit 1b9e04b0 fixes this issue

@mikem changed the status to Closed

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.12

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/231

Please continue any further discussion there.

Metadata