Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backward compatibility with Pyoai is broken #3

Open
akorosov opened this issue Apr 22, 2016 · 3 comments
Open

Backward compatibility with Pyoai is broken #3

akorosov opened this issue Apr 22, 2016 · 3 comments

Comments

@akorosov
Copy link

I was following exactly the Readme:

git clone https://github.com/infrae/moai.git
cd moai/
source bin/activate
pip install -e .
./bin/update_moai moai_example
./bin/paster serve settings.ini

After trying to access
http://localhost:8080/oai?verb=ListIdentifiers&metadataPrefix=oai_dc
The following error appeared:

ERROR:root:Traceback (most recent call last):
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/wsgiutils/wsgiServer.py", line 126, in runWSGIApp
    result = application (env, self.wsgiStartResponse)
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/paste/translogger.py", line 69, in __call__
    return self.application(environ, replacement_start_response)
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/paste/urlmap.py", line 216, in __call__
    return app(environ, start_response)
  File "/home/antonk/py/moai/moai/wsgi.py", line 72, in __call__
    response = self.server.handle_request(WSGIRequest(request))
  File "/home/antonk/py/moai/moai/server.py", line 118, in handle_request
    return req.write(oai_server.handleRequest(req.query_dict()), 'text/xml')
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/oaipmh/server.py", line 311, in handleRequest
    return self.handleException(request_kw, sys.exc_info())
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/oaipmh/server.py", line 323, in handleException
    self._tree_server.handleException(value).getroot(),
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/oaipmh/server.py", line 308, in handleRequest
    return self.handleVerb(verb, request_kw)
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/oaipmh/server.py", line 315, in handleVerb
    return etree.tostring(method(**kw).getroot(),
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/oaipmh/server.py", line 114, in listIdentifiers
    kw)
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/oaipmh/server.py", line 203, in _outputResuming
    result, token = input_func(**kw)
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/oaipmh/common.py", line 126, in method
    return obj(self, **kw)
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/oaipmh/common.py", line 121, in __call__
    return bound_self.handleVerb(self._verb, kw)
  File "/home/antonk/py/moai/local/lib/python2.7/site-packages/oaipmh/server.py", line 425, in handleVerb
    result = list(result)
  File "/home/antonk/py/moai/moai/oai.py", line 90, in listIdentifiers
    yield self._createHeader(record)
  File "/home/antonk/py/moai/moai/oai.py", line 115, in _createHeader
    deleted)
TypeError: __init__() takes exactly 6 arguments (5 given)

Similar issue with oaipmh.common.Metadata(record)

Apparently the recent change in pyoai
infrae/pyoai@46a57f8
introduced new function call pattern.

Suggested fix:

add None to the function call e.g.

oaipmh.common.Header(None
                                    record['id'],
                                    record['modified'],
                                    record['sets'],
                                    deleted)

oaipmh.common.Metadata(None, record)
@mpasternak
Copy link

+1, I have my own branch of pyoai with python 3 support if you need me

@mpasternak
Copy link

mpasternak commented Jul 3, 2017

infrae.com e-mail is dead and phone listed on their company page is not answering

EDIT: we have a contact with maintainer.

@mpasternak
Copy link

@akorosov please check recent pyoai 2.5.0 which is compatible with py3, I used your patch BTW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants