Bug 36846 - Uploading files in distribution: Umlauts do not work
Uploading files in distribution: Umlauts do not work
Product: UCS@school
Classification: Unclassified
Component: UMC - Distribution
UCS@school 4.0
Other Linux
: P5 normal (vote)
: UCS@school 4.0 Errata
Assigned To: Florian Best
Alexander Kramer
Depends on:
Blocks: 37694 37823
  Show dependency treegraph
Reported: 2014-11-19 03:05 CET by Dirk Wiesenthal
Modified: 2023-07-03 12:35 CEST (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:

patch (3.39 KB, patch)
2015-02-16 16:38 CET, Florian Best
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Wiesenthal univentionstaff 2014-11-19 03:05:36 CET
Files with umlauts in their name do not work in distribution. They do not show up in the file system after uploading (but they are saved somehow).

Interestingly, this action (uploading an umlaut containing file) *distributes an undistributed project* immediately.

Firefox. Filename was "companyName_ Wichtige Änderung.PDF"
Comment 1 Dirk Wiesenthal univentionstaff 2014-11-19 10:52:05 CET
May be the space in the file name, though...
Comment 2 Florian Best univentionstaff 2015-02-05 09:45:04 CET
The problem here is cherrypy. It converts the bytestring b'companyName_ Wichtige \xc3\x84nderung.PDF' into the unicode object u'companyName_ Wichtige \xc3\x84nderung.PDF' instead of u'companyName_ Wichtige \xc4nderung.PDF'. The frontend has the filename in javascript and sends it via JSON to the module (which is then UTF-8, maybe also depending on the OS and browser locale?).
In the module it mismatches then name because it is written to the harddisk with the first bytestring-name.
Comment 3 Ammar Najjar univentionstaff 2015-02-06 10:06:49 CET
"90_ucsschool/18_distribute_materials_encoding" written for bug #37694 should test such cases, please enable it after this one is fixed.
Comment 4 Florian Best univentionstaff 2015-02-16 16:32:51 CET
@Sönke: Should we add a workaround in the module so that this will work immediately or should we wait for the patch applied at Bug #37716 which will automatically fix this? The exam mode is also broken in the same way. The patch there has no side effect as the only modules in UCS and UCS@school which uses the filename attribute are ucs-school-umc-distribution and ucs-school-umc-exam.
Comment 5 Florian Best univentionstaff 2015-02-16 16:38:08 CET
Created attachment 6679 [details]
Comment 6 Sönke Schwardt-Krummrich univentionstaff 2015-02-17 11:08:28 CET
Please apply the patch for the distribution and the exam module.
Comment 7 Florian Best univentionstaff 2015-02-17 11:42:38 CET
As Bug #37716 is tagged to UCS 4.0-x added the workaround from the patch for both packages (ucs-school-umc-exam, ucs-school-umc-distribution) supporting fixed and unfixed Bug #37716 in svn r58131.
Comment 8 Alexander Kramer univentionstaff 2015-02-18 12:56:23 CET
Missing self in function signature __workaround_filename_bug(file)
inside schoolexam/__init__.py

Die Ausführung des Kommandos schoolexam/upload ist fehlgeschlagen:

Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/__init__.py", line 176, in _decorated
    return function(self, request, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/decorators.py", line 626, in _response
    return function(self, request)
  File "/usr/lib/pymodules/python2.7/univention/management/console/modules/schoolexam/__init__.py", line 108, in upload
    filename = self.__workaround_filename_bug(file)
TypeError: __workaround_filename_bug() takes exactly 1 argument (2 given)
Comment 9 Florian Best univentionstaff 2015-02-18 13:01:49 CET
fixed, packages are building
Comment 10 Alexander Kramer univentionstaff 2015-02-19 09:14:52 CET
OK - debian/changelog
OK - changelog
OK - Files with umlauts
-- tested:
--- distribution module: utf8 and latin1 with umlauts
--- distribution module: latin1 broken umlaut char
--- exam module: utf8 and latin1 with umlauts
--- exam module: latin1 broken char
Comment 11 Sönke Schwardt-Krummrich univentionstaff 2015-02-27 15:19:39 CET
UCS@school 4.0 v2 has been released:

If this error occurs again, please use "Clone This Bug".