Strict mimetypes or not?
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Start in kobo/http.py at lines 32-40 and read how mimetypes.guess_type is called. Reproduce the containerized .rtf example with strict mode enabled and disabled, then decide which behavior the HTTP handling should use. Done means the chosen behavior is implemented and the .rtf case is verified without relying on /etc/mime.types.
Written by the indexing model from the issue text.
Description
We use mimetypes.guess_type in
https://github.com/release-engineering/kobo/blob/eaff9b42ed27e67ffe0338fdda6df19c948238dd/kobo/http.py#L32-L40
guess_type has strict option set to True by default which means that common_types included in Python stdlib are ignored.
For example, in a containerized environment without /etc/mime.types file, .rtf extension is not resolvable with strict mode turned on:
/usr/bin/python2.7
(None, None)
/usr/bin/python3.10
(None, None)
/usr/bin/python3.6
(None, None)
/usr/bin/python3.8
(None, None)
/usr/bin/python3.9
(None, None)
but without it, it works:
/usr/bin/python2.7
('application/rtf', None)
/usr/bin/python3.10
('application/rtf', None)
/usr/bin/python3.6
('application/rtf', None)
/usr/bin/python3.8
('application/rtf', None)
/usr/bin/python3.9
('application/rtf', None)
so turning off the strict mode might make it better for containerized environments and if we merge #162 we won't need mailcap package for tests (provides /etc/mime.types).
- Dominant language
- Python
- Stars
- 16
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from release-engineering/kobo
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
release-engineering/kobo#270 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
release-engineering/kobo#269 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
release-engineering/kobo#265 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
release-engineering/kobo#238 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
release-engineering/kobo#205 ·
All issues in release-engineering/kobo
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100