Opened 17 years ago
Last modified 17 years ago
#4497 closed defect
AttributeError: 'long' object has no attribute 'astimezone' — at Initial Version
Reported by: | Owned by: | Christopher Lenz | |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | admin/web | Version: | devel |
Severity: | blocker | Keywords: | long astimezone Account Manager users |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
How to Reproduce
While doing a GET operation on /admin/accounts/users
, Trac issued an internal error.
System Information
Trac | 0.11dev
|
Python | 2.5 (r25:51908, Jan 3 2007, 23:53:09) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-56)] |
MySQL | 5.0.27-standard
|
MySQLdb | 1.2.1_p2
|
Genshi | 0.3.6
|
Pygments | 0.6
|
Subversion | 1.4.2
|
Python Traceback
Traceback (most recent call last): File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 395, in dispatch_request dispatcher.dispatch(req) File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 213, in dispatch resp = chosen_handler.process_request(req) File "/usr/local/lib/python2.5/site-packages/trac/admin/web_ui.py", line 84, in process_request path_info) File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 47, in render_admin_panel return self._do_users(req) File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 129, in _do_users account['last_visit'] = format_datetime(last_visit) File "/usr/local/lib/python2.5/site-packages/trac/util/datefmt.py", line 60, in format_datetime t = t.astimezone(tzinfo) AttributeError: 'long' object has no attribute 'astimezone'
Cut and Paste from the web page:
Trac detected an internal error:
AttributeError: 'long' object has no attribute 'astimezone'
If you think this should work you can reproduce the problem, you should consider reporting this to the Trac team.
Before you do that, though, please first try searching for similar issues, as it is quite likely that this problem has been reported before. For questions about installation and configuration of Trac, please try the mailing list instead of filing a ticket.
Trac | 0.11dev | Python | 2.5 (r25:51908, Jan 3 2007, 23:53:09) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-56)] | MySQL | 5.0.27-standard | MySQLdb | 1.2.1_p2 | Genshi | 0.3.6 | Pygments | 0.6 | Subversion | 1.4.2 | ==== Python Traceback ==== Traceback (most recent call last): File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 395, in dispatch_request dispatcher.dispatch(req) File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 213, in dispatch resp = chosen_handler.process_request(req) File "/usr/local/lib/python2.5/site-packages/trac/admin/web_ui.py", line 84, in process_request path_info) File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 47, in render_admin_panel return self._do_users(req) File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 129, in _do_users account['last_visit'] = format_datetime(last_visit) File "/usr/local/lib/python2.5/site-packages/trac/util/datefmt.py", line 60, in format_datetime t = t.astimezone(tzinfo) AttributeError: 'long' object has no attribute 'astimezone' a new ticket at the Trac project site, where you can describe the problem and explain how to reproduce it.
|
System Information: Trac: 0.11dev Python: 2.5 (r25:51908, Jan 3 2007, 23:53:09) [GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-56)] MySQL: 5.0.27-standard MySQLdb: 1.2.1_p2 Genshi: 0.3.6 Pygments: 0.6 Subversion: 1.4.2 Python Traceback Most recent call last:
- File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 395, in dispatch_request
Code fragment:
- req = Request(environ, start_response)
- try:
- try:
- try:
- dispatcher = RequestDispatcher(env)
- dispatcher.dispatch(req)
- except RequestDone:
- pass
- return req._response or []
- finally:
- if not run_once:
- File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 213, in dispatch
Code fragment:
- 'Do you have cookies enabled?')
- # Process the request and render the template
- try:
- try:
- resp = chosen_handler.process_request(req)
- if resp:
- if len(resp) == 2: # Clearsilver
- chrome.populate_hdf(req)
- template, content_type = \
- self._post_process_request(req, *resp)
- File "/usr/local/lib/python2.5/site-packages/trac/admin/web_ui.py", line 84, in process_request
Code fragment:
- provider = providers.get((cat_id, panel_id), None)
- if not provider:
- raise HTTPNotFound('Unknown administration panel')
- template, data = provider.render_admin_panel(req, cat_id, panel_id,
- path_info)
- data.update({
- 'active_cat': cat_id, 'active_panel': panel_id,
- 'panel_href': partial(req.href, 'admin', cat_id, panel_id),
- 'panels': [{
- 'category': {'id': panel[0], 'label': panel[1]},
- File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 47, in render_admin_panel Local variables: Name Value cat u'accounts' page u'users' path_info None req <Request "GET /admin/accounts/users"> self <acct_mgr.admin.AccountManagerAdminPage object at 0xb6cda70c>
- File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 129, in _do_users Local variables: Name Value account { XXXX DELETED FOR SECURITY XXXX accounts { XXXX DELETED FOR SECURITY XXXX create_enabled True cursor <trac.db.util.IterableCursor object at 0xb6ca4cd4> data {'create_enabled': True, 'delete_enabled': True, 'listing_enabled': True} db <trac.db.pool.PooledConnection object at 0xb6c3462c> delete_enabled True email XXXX DELETED FOR SECURITY XXXX last_visit 1167955396L listing_enabled True name XXXX DELETED FOR SECURITY XXXX perm <trac.perm.PermissionSystem object at 0xb6ce630c> req <Request "GET /admin/accounts/users"> self <acct_mgr.admin.AccountManagerAdminPage object at 0xb6cda70c> username XXXX DELETED FOR SECURITY XXXX
- File "/usr/local/lib/python2.5/site-packages/trac/util/datefmt.py", line 60, in format_datetime
Code fragment:
- tzinfo = localtz
- if t is None:
- t = datetime.now(utc)
- if isinstance(t, int):
- t = datetime.fromtimestamp(t, tzinfo)
- t = t.astimezone(tzinfo)
- text = t.strftime(format)
- encoding = locale.getpreferredencoding()
- if sys.platform != 'win32':
- encoding = locale.getlocale(locale.LC_TIME)[1] or encoding
- # the above is broken on win32, e.g. we'd get '437' instead of 'cp437'
File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 394, in dispatch_request
dispatcher.dispatch(req)
File "/usr/local/lib/python2.5/site-packages/trac/web/main.py", line 212, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/local/lib/python2.5/site-packages/trac/admin/web_ui.py", line 83, in process_request
path_info)
File "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 46, in render_admin_panelFile "build/bdist.linux-i686/egg/acct_mgr/admin.py", line 128, in _do_usersFile "/usr/local/lib/python2.5/site-packages/trac/util/datefmt.py", line 59, in format_datetime
t = t.astimezone(tzinfo)
TracGuide — The Trac User and Administration Guide