I changed in src/checker/tests.py all Unit Tests for R Checker which fail by NOT NULL constraint : missing mimetype for example.R
And I add a mimetype for ("text/x-r-script", ".r") in src/settings/defaults.py.
Rationale:
since merged pull requests in Python stdlib mimetypes.guess_type only searches for small letters to determine mimetype for files.
This pull request should fix https://github.com/KITPraktomatTeam/Praktomat/issues/336 using a workaround needed caused by Python stdlib bug https://github.com/python/cpython/issues/92455.
I changed in
src/checker/tests.py
all Unit Tests for R Checker which fail by NOT NULL constraint : missing mimetype for example.R And I add a mimetype for ("text/x-r-script", ".r") insrc/settings/defaults.py
.Rationale: since merged pull requests in Python stdlib
mimetypes.guess_type
only searches for small letters to determine mimetype for files.Because the file
example.R
has capital letter, a mimetype for that endig has been added using the capital letterR
. https://github.com/KITPraktomatTeam/Praktomat/blob/d7707f6b4f5d9b5c1eab61d8ea80313bf0486ff4/src/settings/defaults.py#L403-L410 Sadly the current implementation ofmimetypes.guess_type
in Python stdlib can only handle small letters.