Error on form submit when school year name has accented characters

Bug #1234690 reported by Ricardo
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SchoolTool
Fix Released
High
Gediminas Paulauskas
SchoolTool CanDo
Fix Released
High
Gediminas Paulauskas
SchoolTool Gradebook
Fix Released
High
Gediminas Paulauskas

Bug Description

Error trying to import courses from a simple CSV file.

This is the content of the CSV file
"Matematicas.,,
Geografía.,,
Biología.,,
Educación Física.,,
Historia.,,
Teatro.,,"

and I get this:

Ha ocurrido un error del servidor interno. Esto probablemente significa que ha encontrado un fallo en SchoolTool. Por favor reportelo a la seccion de fallos..
Excepción

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf1' in position 45: ordinal not in range(128)

Traza

File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 132, in publish
  result = publication.callObject(request, obj)
File "/usr/lib/python2.7/dist-packages/zope/app/publication/zopepublication.py", line 207, in callObject
  return mapply(ob, request.getPositionalArguments(), request)
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 107, in mapply
  return debug_call(obj, args)
Extra information: <schooltool.skin.flourish.zcml_content.FlourishCourseCSVImportView_csvimport.html object at 0x7f98142e7d10>
File "/usr/lib/python2.7/dist-packages/zope/publisher/publish.py", line 113, in debug_call
  return obj(*args)
File "/usr/lib/python2.7/dist-packages/schooltool/skin/flourish/page.py", line 77, in __call__
  self.update()
File "/usr/lib/python2.7/dist-packages/schooltool/app/browser/csvimport.py", line 167, in update
  return BaseCSVImportView.update(self)
File "/usr/lib/python2.7/dist-packages/schooltool/app/browser/csvimport.py", line 127, in update
  self.request.response.redirect(next_url)
File "/usr/lib/python2.7/dist-packages/zope/publisher/browser.py", line 759, in redirect
  return super(BrowserResponse, self).redirect(location, status, trusted)
File "/usr/lib/python2.7/dist-packages/zope/publisher/http.py", line 877, in redirect
  location = str(location)

Related branches

Revision history for this message
Tom Hoffman (tom-hoffman) wrote :

Please use the XLS import sheet for courses.

Revision history for this message
Gediminas Paulauskas (menesis) wrote :

The import succeeds, only redirect back to the courses list fails.

Changed in schooltool:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Gediminas Paulauskas (menesis)
Revision history for this message
Ricardo (ricardoeureka) wrote : Re: [Bug 1234690] Re: Error trying to import courses from asimple CSV file

El 03/10/13 11:01, Tom Hoffman escribió:
> Please use the XLS import sheet for courses.
>
Dear Tom

Thank you very much for your response. I will try XLS import, but, I'd
really like to make the CSV import work.
Is it possible? Is this a known bug to be solved in future versions or
I'm doing something wrong?
Thanks in advance for your support and help

Revision history for this message
Ricardo (ricardoeureka) wrote :

El 03/10/13 11:03, Gediminas Paulauskas escribió:
> The import succeeds, only redirect back to the courses list fails.
>
> ** Changed in: schooltool
> Status: New => In Progress
>
> ** Changed in: schooltool
> Importance: Undecided => High
>
> ** Changed in: schooltool
> Assignee: (unassigned) => Gediminas Paulauskas (menesis)
>
Dear Gediminas,
That's not correct. The import is failing: data is not loaded into the
database

Revision history for this message
Tom Hoffman (tom-hoffman) wrote : Re: Error trying to import courses from asimple CSV file

Generally, we're moving toward removing these CSV imports and just supporting the XLS imports.

Revision history for this message
Gediminas Paulauskas (menesis) wrote :

I reproduced this same error with a school year name with accented characters, e.g. vacación

the URL would be http://localhost:7080/schoolyears/vacación/courses/csvimport.html and it fails to get back to courses list.

Maybe you need to choose a different encoding, e.g. ISO-8859-1 for Spanish? But I get a red error message saying "Could not convert data to Unicode (incorrect charset?)" instead of an exception.

What version of SchoolTool are you running? Look at the bottom of the page.

Changed in schooltool:
status: In Progress → Fix Committed
Revision history for this message
Ricardo (ricardoeureka) wrote : Re: [Bug 1234690] Re: Error trying to import courses from asimple CSV file

El 03/10/13 12:52, Gediminas Paulauskas escribió:
> I reproduced this same error with a school year name with accented
> characters, e.g. vacación
>
> the URL would be
> http://localhost:7080/schoolyears/vacación/courses/csvimport.html and it
> fails to get back to courses list.
>
> Maybe you need to choose a different encoding, e.g. ISO-8859-1 for
> Spanish? But I get a red error message saying "Could not convert data to
> Unicode (incorrect charset?)" instead of an exception.
>
> What version of SchoolTool are you running? Look at the bottom of the
> page.
>
I'm running version 2.1 on Ubuntu 12.04, but I think that the situation
you reproduced is not exactly the same:
- I have no accent on the yearschool
- I used ISO-8859-1 with same result
- I tried to load both CSV and on the screen without any accent with the
same result.

I figured out the problem: I entered "Año 2013" for the school year's
name. It seems that the "ñ" is the issue. I created a new schoolyear,
named only "2013" and I succeeded to load a CSV both from file and in
the screen manually.
Thanks for your time

Changed in schooltool:
milestone: none → 2.6.0
description: updated
summary: - Error trying to import courses from asimple CSV file
+ Error on form submit when school year name has accented characters
Revision history for this message
Gediminas Paulauskas (menesis) wrote :

Yes, accented characters in school year name have caused this issue.

I have fixed similar problem in several other pages. Additionally, made sure that selected school year is preserved when navigating and submitting forms inside the School tab.

This will be in 2.6.0 release next week.

Changed in schooltool:
status: Fix Committed → Fix Released
Changed in schooltool.gradebook:
status: New → Fix Released
importance: Undecided → High
assignee: nobody → Gediminas Paulauskas (menesis)
milestone: none → 2.6.0
Changed in schooltool.cando:
status: New → Fix Released
importance: Undecided → High
assignee: nobody → Gediminas Paulauskas (menesis)
milestone: none → 2.6.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.