Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 5640548127866880: Issue 2678 - Don't consider local files and Windows registry when guessing mime types (Closed)

Created:
June 12, 2015, 9:41 p.m. by Sebastian Noack
Modified:
June 29, 2015, 11:12 a.m.
Visibility:
Public.

Description

Issue 2678 - Don't consider local files and Windows registry when guessing mime types

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -4 lines) Patch
M cms/bin/test_server.py View 2 chunks +4 lines, -4 lines 1 comment Download

Messages

Total messages: 4
Sebastian Noack
June 12, 2015, 9:42 p.m. (2015-06-12 21:42:14 UTC) #1
kzar
LGTM
June 15, 2015, 3:21 p.m. (2015-06-15 15:21:08 UTC) #2
Wladimir Palant
https://codereview.adblockplus.org/5640548127866880/diff/5629499534213120/cms/bin/test_server.py File cms/bin/test_server.py (right): https://codereview.adblockplus.org/5640548127866880/diff/5629499534213120/cms/bin/test_server.py#newcode51 cms/bin/test_server.py:51: mimetypes.init([]) Re-reading the source code I can see the ...
June 29, 2015, 10:42 a.m. (2015-06-29 10:42:32 UTC) #3
Sebastian Noack
June 29, 2015, 11:12 a.m. (2015-06-29 11:12:55 UTC) #4
Message was sent while issue was closed.
On 2015/06/29 10:42:32, Wladimir Palant wrote:
>
https://codereview.adblockplus.org/5640548127866880/diff/5629499534213120/cms...
> File cms/bin/test_server.py (right):
> 
>
https://codereview.adblockplus.org/5640548127866880/diff/5629499534213120/cms...
> cms/bin/test_server.py:51: mimetypes.init([])
> Re-reading the source code I can see the issue - MimeTypes class actually
calls
> mimetypes.init() implicitly, without parameters. It merely allows specifying
> *additional* file names, these won't replace the default ones however. It
seems
> that we cannot avoid changing global state here, and we have to accept that
> things will fail badly if somebody else initializes mimetypes module before
us.
> That module is seriously misdesigned, maybe somebody wants to file a bug on
it.

Here you go: https://bugs.python.org/issue24527

But I'm almost certain that this won't be addressed in Python 2 anymore, if at
all.

Powered by Google App Engine
This is Rietveld