omekadd icon indicating copy to clipboard operation
omekadd copied to clipboard

Export to csv fails

Open pprw opened this issue 8 years ago • 3 comments

Hey,

I have this error when trying to export to cvs. Omekacsv works fine in another Omeka test site. I suspect the problem is related to some particular symbols inside the items fields or related to the encoding.

Any idea?

$ ./omekacsv.py 
200 OK
Getting results page 1 of 54 ...
200 OK
Traceback (most recent call last):
  File "./omekacsv.py", line 51, in <module>
    get_all_pages(pages)
  File "./omekacsv.py", line 40, in get_all_pages
    data.extend(json.loads(content))
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

pprw avatar Jan 05 '17 15:01 pprw

Are the two Omeka sites running the same versions of Omeka?

On Thu, Jan 05, 2017 at 07:16:16AM -0800, pprw wrote:

Hey,

I have this error when trying to export to cvs. Omekacsv works fine in another Omeka test site. I suspect the problem is related to some particular symbols inside the items fields or related to the encoding.

Any idea?

$ ./omekacsv.py
200 OK
Getting results page 1 of 54 ...
200 OK
Traceback (most recent call last):
 File "./omekacsv.py", line 51, in <module>
   get_all_pages(pages)
 File "./omekacsv.py", line 40, in get_all_pages
   data.extend(json.loads(content))
 File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
   return _default_decoder.decode(s)
 File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
   obj, end = self.raw_decode(s, idx=_w(s, 0).end())
 File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
   raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/wcaleb/omekadd/issues/4

wcaleb avatar Jan 06 '17 18:01 wcaleb

Le 06/01/2017 à 19:33, W. Caleb McDaniel a écrit :

Are the two Omeka sites running the same versions of Omeka?

Thank for your answer. The versions are different: 2.3.1 for the problematic website and 2.4.1 for the test one (where csv export works fine).

Could it be the source of the error? I am a little bit afraid to update the 2.3.1 before the csv export.

pprw avatar Jan 06 '17 18:01 pprw

I don't think the difference between those subversions should make a difference, but I haven't used the script recently so I would have to look more closely at it. Are you sure that you've edited the endpoint at the top of the script? Can you add things successfully to the 2.3 site using omekadd?

wcaleb avatar Jan 07 '17 18:01 wcaleb