Modify

Opened 12 years ago

Closed 12 years ago

Last modified 2 years ago

#10402 closed defect (fixed)

AttributeError: 'builtin_function_or_method' object has no attribute 'new'

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Component: ClientsPlugin
Severity: normal Keywords:
Cc: Colin Guthrie Trac Release: 1.0

Description

How to Reproduce

While doing a GET operation on /admin/ticket/clientevents, Trac issued an internal error.

(please provide additional details here)

Request parameters:

{'cat_id': u'ticket', 'panel_id': u'clientevents', 'path_info': None}

User agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1

System Information

Trac 1.1.1dev-r0
Genshi 0.6 (without speedups)
Pygments 1.3.1
pysqlite 2.6.0
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5]
setuptools 0.6
SQLite 3.7.3
jQuery 1.7.2

Enabled Plugins

clients 0.5dev

Python Traceback

Traceback (most recent call last):
  File "/home/user/Workspace/th10260/trac-trunk/trac/web/main.py", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File "/home/user/Workspace/th10260/trac-trunk/trac/web/main.py", line 233, in dispatch
    content_type)
  File "/home/user/Workspace/th10260/trac-trunk/trac/web/chrome.py", line 1008, in render_template
    encoding='utf-8')
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/core.py", line 183, in render
    return encode(generator, method=method, encoding=encoding, out=out)
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/output.py", line 58, in encode
    for chunk in iterator:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/output.py", line 339, in __call__
    for kind, data, pos in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/output.py", line 826, in __call__
    for kind, data, pos in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/output.py", line 670, in __call__
    for kind, data, pos in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/output.py", line 771, in __call__
    for kind, data, pos in chain(stream, [(None, None, None)]):
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/output.py", line 586, in __call__
    for ev in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th10260/trac-trunk/trac/web/chrome.py", line 1145, in _strip_accesskeys
    for kind, data, pos in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th10260/trac-trunk/trac/web/chrome.py", line 1134, in _generate
    for kind, data, pos in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/markup.py", line 378, in _match
    ctxt, start=idx + 1, **vars):
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/markup.py", line 327, in _match
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/path.py", line 588, in _generate
    subevent = next()
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/markup.py", line 316, in _strip
    event = next()
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/path.py", line 588, in _generate
    subevent = next()
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/markup.py", line 316, in _strip
    event = next()
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/core.py", line 288, in _ensure
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/path.py", line 588, in _generate
    subevent = next()
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/base.py", line 605, in _include
    for event in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/markup.py", line 316, in _strip
    event = next()
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/base.py", line 545, in _flatten
    for kind, data, pos in stream:
  File "/home/user/Workspace/th10260/genshi-0.6.0/genshi/template/directives.py", line 366, in __call__
    for item in iterable:
  File "/home/user/Workspace/trac-hacks/clientsplugin/trunk/clients/events.py", line 226, in select
    clev.md5 = md5.new(name).hexdigest()
AttributeError: 'builtin_function_or_method' object has no attribute 'new'

Attachments (0)

Change History (3)

comment:1 Changed 12 years ago by Ryan J Ollos

The md5 class that is imported from the hashlib module does not have a new method. Rather, we need to implement the import compatibility similar to how the AccountManagerPlugin has done it: accountmanagerplugin/trunk/acct_mgr/hashlib_compat.py@11864.

comment:2 Changed 12 years ago by Ryan J Ollos

(In [12091]) Refs #10402: Support use of md5 class from the hashlib module or deprecated md5 module, with preference to the former when available.

comment:3 Changed 12 years ago by Ryan J Ollos

Resolution: fixed
Status: newclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.