This is a snapshot of Indico's old Trac site. Any information contained herein is most probably outdated. Access our new GitHub site here.

Opened 2 years ago

Closed 15 months ago

#1411 closed defect (needfeedback)

bug when try to export in ical file

Reported by: jas Owned by: arescope
Priority: high Milestone: v1.2
Component: General Version: 1.1
Keywords: Cc:

Description

When I try to export in ical format the "Detailed timetable calendar file" in some event I got this error

Error details

exception message => 'ascii' codec can't decode byte 0xc3 in position 31: ordinal not in range(128)
exception type => <type 'exceptions.UnicodeDecodeError?'>
traceback =>

File "/usr/local/lib/python2.7/site-packages/indico-1.1-py2.7.egg/MaKaC/webinterface/rh/base.py", line 586, in process

res = self._process()


File "/usr/local/lib/python2.7/site-packages/indico-1.1-py2.7.egg/MaKaC/webinterface/rh/conferenceDisplay.py", line 1054, in _process

data = serializer(resultFossil)


File "/usr/local/lib/python2.7/site-packages/indico-1.1-py2.7.egg/indico/web/http_api/metadata/serializer.py", line 64, in call

self._data = self._execute(obj, *args, kwargs)


File "/usr/local/lib/python2.7/site-packages/indico-1.1-py2.7.egg/indico/web/http_api/metadata/ical.py", line 163, in _execute

mapper(cal, fossil, now)


File "/usr/local/lib/python2.7/site-packages/indico-1.1-py2.7.egg/indico/web/http_api/metadata/ical.py", line 126, in serialize_contribs

serialize_event(cal, sfossil, now, id_prefix="indico-contribution")


File "/usr/local/lib/python2.7/site-packages/indico-1.1-py2.7.egg/indico/web/http_api/metadata/ical.py", line 79, in serialize_event

description += html.fromstring(desc_text.decode('utf-8')).text_content() + '\n\n'+ fossilurl?


request handler => MaKaC.webinterface.rh.conferenceDisplay.RHConferenceToiCal
url => โ€‹https://indico.math.cnrs.fr/conferenceDisplay.py/ical?detail=contributions&confId=XYZ

If you want to try substitute XYZ in this log by 21

I put this ticket in priority high because we use this feature to extract data from indico.

Regards

Change History (13)

comment:1 Changed 2 years ago by jbenito

  • Milestone set to v1.1
  • Owner set to arescope
  • Status changed from new to assigned

comment:2 Changed 2 years ago by arescope

Dear jas,

I detect that the contribution raising the exception is the one with id: 11.

I detect by going manually, but you can also do by indico_shell. You can take a look about the indico_shell in โ€‹https://indico.cern.ch/getFile.py/access?contribId=29&sessionId=3&resId=2&materialId=slides&confId=235520.

you need to do for this special case:

conf = ConferenceHolder?().getById('21')
contrib = conf.getContributionById('11')

contrib.setDescription(contrib.getDescription().decode("ISO 8859-1").encode("utf-8"))

If it is not description it might can be another field and I would need to take a deeply look.

Regards

comment:3 Changed 2 years ago by arescope

  • Status changed from assigned to in_work

comment:4 Changed 2 years ago by arescope

Dear jas,

Did you manage to fix it?

Best regards

comment:5 Changed 23 months ago by arescope

Dear jas,

Maybe you did not receive the notification.

Could you please confirm that now it is working?

Best regards,

Alberto

comment:6 Changed 23 months ago by jas

Sorry I didn't see your message.

I've already answer to you by email. But I don't knwon if you received it or not (maybe it's just technical account).

So here the resume of my mail :

No it's not working but I find the problem :

The problem appear IF AND ONLY IF both the CONTENT and the PRESENTER containt non 7bits-ASCII. (Presenter not primary author)

So if the content have some non-7bits-ASCII and the presenter don't have, everything work fine (event if the primary author get some UTF-8).

The only case I can find is when both have. I our situation the author got a "รง" and of course the content got many non 7 bits-characters.

I already do all check on the web interface and the problem is fully reproducible

Regards.

comment:7 Changed 23 months ago by arescope

Hi,

Could you first check in your Apache configuration if you have

AddDefaultCharset? UTF-8

And for solve that problem in the shell you may do:

conf = ConferenceHolder().getById('21')
contrib = conf.getContributionById('11')
for spk in contrib.getSpeakerList():
    spk.setFamilyName(spk.getFamilyName().decode("ISO 8859-1").encode("utf-8"))
    spk.setFirstName(spk.getFirstName().decode("ISO 8859-1").encode("utf-8"))

dbi.commit()

comment:8 Changed 18 months ago by arescope

Hi, any news on this?

comment:9 Changed 18 months ago by pferreir

  • Milestone changed from v1.1 to v1.2

comment:10 Changed 18 months ago by jbenito

  • Status changed from in_work to awaiting_merge

comment:11 Changed 18 months ago by pferreir

Why is this awaiting merge? Are there any news?

comment:12 Changed 15 months ago by pferreir

  • Status changed from awaiting_merge to assigned

Closing due to lack of feedback. Please reopen if needed.

comment:13 Changed 15 months ago by pferreir

  • Resolution set to needfeedback
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.