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

Various issues in OAIBasedContentProvider #2

Open
wetneb opened this issue Oct 18, 2014 · 0 comments
Open

Various issues in OAIBasedContentProvider #2

wetneb opened this issue Oct 18, 2014 · 0 comments

Comments

@wetneb
Copy link

wetneb commented Oct 18, 2014

First, its __init__ function is waiting for two arguments (not counting
self as an argument), but it is called with only one argument (the URI
of the source to fetch the data from) in the file tools.py at line 103:

Traceback (most recent call last):
  File "./moai/bin/update_moai", line 9, in <module>
    load_entry_point('MOAI==2.0.0', 'console_scripts', 'update_moai')()
  File "/home/antonin/Programmation/MOAI-2.0.0/moai/tools.py", line 103,
in update_moai
    provider = provider_point.load()(config['provider'])
TypeError: __init__() takes at least 3 arguments (2 given)

Second, it is necessary to specify the URI of the OAI archive as
oai://export.arxiv.org/oai2 for instance (so that the
OAIBasedContentProvider is selected). But then, this oai:// URI is
sent to the HTTP client without changing the prefix to http://, hence
an error:

Updating content provider..Traceback (most recent call last):
  File "./moai/bin/update_moai", line 9, in <module>
    load_entry_point('MOAI==2.0.0', 'console_scripts', 'update_moai')()
  File "/home/antonin/Programmation/MOAI-2.0.0/moai/tools.py", line 120,
in update_moai
    for id in provider.update(from_date):
  File "/home/antonin/Programmation/MOAI-2.0.0/moai/provider/oai.py",
line 36, in update
    from_ = from_date):
  File
"/home/antonin/Programmation/MOAI-2.0.0/moai/local/lib/python2.7/site-packages/oaipmh/common.py",
line 115, in method
    return obj(self, **kw)
  File
"/home/antonin/Programmation/MOAI-2.0.0/moai/local/lib/python2.7/site-packages/oaipmh/common.py",
line 110, in __call__
    return bound_self.handleVerb(self._verb, kw)
  File
"/home/antonin/Programmation/MOAI-2.0.0/moai/local/lib/python2.7/site-packages/oaipmh/client.py",
line 65, in handleVerb
    kw, self.makeRequestErrorHandling(verb=verb, **kw))
  File
"/home/antonin/Programmation/MOAI-2.0.0/moai/local/lib/python2.7/site-packages/oaipmh/client.py",
line 269, in makeRequestErrorHandling
    xml = self.makeRequest(**kw)
  File
"/home/antonin/Programmation/MOAI-2.0.0/moai/local/lib/python2.7/site-packages/oaipmh/client.py",
line 316, in makeRequest
    return retrieveFromUrlWaiting(request)
  File
"/home/antonin/Programmation/MOAI-2.0.0/moai/local/lib/python2.7/site-packages/oaipmh/client.py",
line 343, in retrieveFromUrlWaiting
    f = urllib2.urlopen(request)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 404, in open
    response = self._open(req, data)
  File "/usr/lib/python2.7/urllib2.py", line 427, in _open
    'unknown_open', req)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 1232, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib2.URLError: <urlopen error unknown url type: oai>

Third, we get another error, probably due to the fact that the argument
'output_path' passed to __init__ is not stored in self.path.

Updating content provider..Traceback (most recent call last):
  File "./moai/bin/update_moai", line 9, in <module>
    load_entry_point('MOAI==2.0.0', 'console_scripts', 'update_moai')()
  File "/home/antonin/Programmation/MOAI-2.0.0/moai/tools.py", line 120,
in update_moai
    for id in provider.update(from_date):
  File "/home/antonin/Programmation/MOAI-2.0.0/moai/provider/oai.py",
line 38, in update
    added = self._process_record(header, element)
  File "/home/antonin/Programmation/MOAI-2.0.0/moai/provider/oai.py",
line 52, in _process_record
    path = os.path.join(self.path, '%s.xml' % oai_id)
AttributeError: 'OAIBasedContentProvider' object has no attribute 'path'

I have not tried to fix this problem and see if others pop up after that.

I do not expect this kind of errors to be caused by a faulty
configuration. If it is the case, I think it would be very useful to
detect these problems at the source, because it is very hard to figure
out what is faulty in the setup with errors like this.

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

1 participant