Opened 15 years ago
Closed 14 years ago
#6948 closed defect (worksforme)
Internal error
Reported by: | Owned by: | Radek Bartoň | |
---|---|---|---|
Priority: | highest | Component: | DiscussionPlugin |
Severity: | blocker | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
I've installed your plugin on Trac 0.11 without problems. I've created test forum, topic and post first message on it. And now, after click on Discussion link in upper menu I see:
Trac detected an internal error: TypeError: expecting datetime, int, long, float, or None; got <type 'unicode'>
Python Traceback
Most recent call last: File "/root/.python-eggs/TracDiscussion-0.7-py2.4.egg-tmp/tracdiscussion/templates/forum-list.html", line 70, in <Expression u"forum.lasttopic and format_datetime(forum.lasttopic) or 'no topics'">
${forum.lasttopic and format_datetime(forum.lasttopic) or 'no topics'}<br/>
File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/util/datefmt.py", line 108, in format_datetime
t = to_datetime(t, tzinfo).astimezone(tz)
File "/usr/lib/python2.4/site-packages/Trac-0.11.6-py2.4.egg/trac/util/datefmt.py", line 52, in to_datetime
raise TypeError('expecting datetime, int, long, float, or None; got %s' %
Any ideas?
Attachments (2)
Change History (16)
comment:1 Changed 15 years ago by
Status: | new → assigned |
---|
comment:2 Changed 15 years ago by
I don't know how to evoke this. Can you evoke it aggain or this just happened accidentaly? Can you describe precise procedure of evokation (Values of fields you are filling in, etc)? Can you post Trac log with DEBUG level enabled? What is you server configuration?
Changed 15 years ago by
Attachment: | Python Traceback.png added |
---|
The python traceback I get with this error
comment:3 Changed 15 years ago by
I can confirm this same bug. I created 4 forums, filling out [subject] and [description] with ONLY letters and spaces (no punctuation, no wiki-links) adding 1 moderator, and adding 1 subscriber (my email). Then I posted in one of these forums. At first, everything works fine, but then after a period of time the bug occurs. It looks like it may have to do with fetching the date/time of the last post, perhaps?
Changed 15 years ago by
Attachment: | System Info.png added |
---|
Information on the system I get this bug on
comment:4 Changed 15 years ago by
I can't post either wiki text or pictures of my pythong traceback and system info; blocked as spam.
comment:5 Changed 15 years ago by
Okay: the bug offiially occurs for me when I have 1 or more posts in any forum. I can create forums just fine; it's creating threads that produces the error.
System Information:
- User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
- Trac: 0.11.5
- Python: 2.3.3 (#1, May 7 2004, 10:31:40) [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)]
- setuptools: 0.6c5
- SQLite: 2.8.16
- pysqlite: 1.0.1
- Genshi: 0.5.1
- mod_python: < 3.2
- Subversion: 1.2.1 (r15230)
- jQuery: 1.2.6
comment:6 Changed 15 years ago by
I've been looking at the source code. It appears that the "forum.lasttopic" variable you pass into format_datetime on line 70 or so of forum-list.html is supposed to be a datetime, int, long, or float.
If I am understanding thing correctly, format_datetime and to_datetime are library functions. Can you convert forum.lastopic from unicode to a datetime object before you pass it to format_datetime? That way even if the script changes you will have already converted it and it won't throw an error.
I could be wrong though.
comment:8 Changed 15 years ago by
Great thanks for investigating this. I'll fix it as soon as I'll have spare minute...
comment:9 Changed 14 years ago by
Quick question - do you think this could be related to the Python version I'm running? On my personal computer with Python 2.6 I don't get this bug, but on my employer's server running python 2.3, I do.
-- Thanks
comment:10 Changed 14 years ago by
It's possible and it would explain why I couldn't evoke it since I wasn't using Python 2.3 for years. I may also be related to Gensi version. Could you please check what is your and your employers Genshi versions?
comment:11 Changed 14 years ago by
Genshi version is 0.5.1
System Information:
- User Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
- Trac: 0.11.5
- Python: 2.3.3 (#1, May 7 2004, 10:31:40) [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)]
- setuptools: 0.6c5
- SQLite: 2.8.16
- pysqlite: 1.0.1
- Genshi: 0.5.1
- mod_python: < 3.2
- Subversion: 1.2.1 (r15230)
- jQuery: 1.2.6
comment:13 Changed 14 years ago by
On my personal computer I have Genshi .6
System Information:
- Trac: 0.11.7
- Python: 2.6.5 (r265:79063, May 25 2010, 02:35:04) [GCC 4.2.1 (Apple Inc. build 5646)]
- setuptools: 0.6
- SQLite: 3.6.23
- pysqlite: 2.4.1
- Genshi: 0.6
- Pygments: 1.3.1
- jQuery: 1.2.6
comment:14 Changed 14 years ago by
Resolution: | → worksforme |
---|---|
Status: | assigned → closed |
I see nothing wrong in the code and it works fine for me. I'm closing the ticket. If the problem persists on the lastest Trac, please reopen.
I'll check that lately.