Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

#12138 closed defect (invalid)

AttributeError: 'module' object has no attribute 'Consumer'

Reported by: Ryan J Ollos Owned by: Dirk Stöcker
Priority: normal Milestone:
Component: plugin/spamfilter Version: 1.0.7
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

How to Reproduce

While doing a POST operation on /admin/spamfilter/external, Trac issued an internal error.

I added public / private keys for Mollom and pressed Apply changes.

Request parameters: Sensitive information removed

User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.132 Safari/537.36

System Information

Trac 1.0.7
Babel 1.3
Docutils 0.12
FullBlog 0.1.1.post13462
Genshi 0.6 (with speedups)
mod_wsgi 3.3 (WSGIProcessGroup trac-hacks-010 WSGIApplicationGroup %{GLOBAL})
psycopg2 2.2.1
Pygments 1.6
Python 2.6.6 (r266:84292, Dec 27 2010, 00:18:12)
[GCC 4.4.5]
pytz 2013b
RPC 1.1.2.post13776
setuptools 18.0.1
Subversion 1.6.12 (r955767)
jQuery 1.7.2
jQuery UI 1.8.21
jQuery Timepicker 1.0.1

Enabled Plugins

BlogDraftPlugin N/A
ChangeLogMacro 0.4.dev0
EmailProcessor r10962
FootNoteMacro 1.4.post13654
SvnAuthzAdminPlugin 1.0.dev0
TracAccountManager 0.4.3
TracAcronyms 0.2dev-r10459
TracAutoWikify 0.2dev-r11905
TracExtractUrl 0.2.7030
TracFullBlogPlugin 0.1.1.post13462
TracHacks 3.0.dev0
TracIncludeMacro 3.0.0.dev0
TracIniAdminPanel 1.0.1.post14508
TracNewsFlash 1.0.1
TracPoll 0.3.0dev-r11670
TracServerSideRedirectPlugin 0.4
TracSpamFilter 1.0.6.dev0
TracTags 0.8.dev0
TracTocMacro 11.0.0.5.post14509
TracVote 0.3.0
TracWikiExtras 1.0dev-r14316
TracXMLRPC 1.1.2.post13776

Python Traceback

Traceback (most recent call last):
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 550, in _dispatch_request
    dispatcher.dispatch(req)
  File "build/bdist.linux-i686/egg/trac/web/main.py", line 243, in dispatch
    resp = chosen_handler.process_request(req)
  File "build/bdist.linux-i686/egg/trac/admin/web_ui.py", line 119, in process_request
    path_info)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/admin.py", line 383, in render_admin_panel
    if mollom and mollom_public_key and mollom_private_key and not mollom.verify_key(req, mollom_api_url, mollom_public_key, mollom_private_key):
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/filters/mollom.py", line 164, in verify_key
    resp, content = self._call("site/%s" % public_key, None, public_key, private_key, api_url)
  File "/srv/trac-hacks.org/pve/lib/python2.6/site-packages/TracSpamFilter-1.0.6.dev0-py2.6.egg/tracspamfilter/filters/mollom.py", line 128, in _call
    consumer = oauth2.Consumer(public_key, private_key)
AttributeError: 'module' object has no attribute 'Consumer'

Attachments (0)

Change History (2)

comment:1 by Ryan J Ollos, 9 years ago

Running the latest version of TracSpamFilter, 1.0.6 r14092.

>>> import oauth2
>>> oauth2.VERSION
'0.7.0'
Last edited 9 years ago by Ryan J Ollos (previous) (diff)

comment:2 by Ryan J Ollos, 9 years ago

Resolution: invalid
Status: newclosed

I had oauthlib-0.7.2 and python-oauth2-0.7.0 also installed. I removed those with pip uninstall.

>>> import oauth2
>>> dir(oauth2)
['Client', 'Consumer', 'Error', 'HTTP_METHOD', 'MissingSignature', 'OAUTH_VERSION', 'Request', 'SIGNATURE_METHOD', 'Server', 'SignatureMethod', 'SignatureMethod_HMAC_SHA1', 'SignatureMethod_PLAINTEXT', 'Token', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', '_version', 'base64', 'binascii', 'build_authenticate_header', 'build_xoauth_string', 'escape', 'generate_nonce', 'generate_timestamp', 'generate_verifier', 'hmac', 'httplib2', 'parse_qs', 'random', 'setter', 'sha', 'sha1', 'time', 'to_unicode', 'to_unicode_if_string', 'to_unicode_optional_iterator', 'to_utf8', 'to_utf8_if_string', 'to_utf8_optional_iterator', 'urllib', 'urlparse']
>>> oauth2.__version__
LooseVersion ('1.5.211')

Now I can successfully add the Mollom keys.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Dirk Stöcker.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Dirk Stöcker to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.