Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65650

Re: Possible bug with stability of mimetypes.guess_* function output

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:bug': 0.07; 'ambiguity': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'wrapper': 0.09; 'bug': 0.12; 'dict': 0.16; 'mimetypes': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'rejected.': 0.16; 'subject:skip:m 10': 0.16; 'unambiguous': 0.16; 'wrote:': 0.18; 'module': 0.19; 'header:User-Agent:1': 0.23; 'requirement.': 0.24; '(or': 0.24; 'extension': 0.26; 'least': 0.26; 'defined': 0.27; 'header:X-Complaints-To:1': 0.27; 'thus': 0.29; 'that.': 0.31; 'libraries': 0.31; 'workaround': 0.31; 'file': 0.32; 'guess': 0.33; 'could': 0.34; 'subject:with': 0.35; 'doing': 0.36; 'las': 0.37; 'easily': 0.37; 'mapping': 0.38; 'needed': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'ensure': 0.60; 'map': 0.64; 'guessed': 0.84; 'otten': 0.84; 'subject:Possible': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Peter Otten <__peter__@web.de>
Subject Re: Possible bug with stability of mimetypes.guess_* function output
Date Sat, 08 Feb 2014 09:39:06 +0100
Organization None
References <ld37bb$7ji$1@news.albasani.net> <03a2c4c8-313f-4382-8be9-5163d8bf644c@googlegroups.com> <mailman.6497.1391802017.18130.python-list@python.org> <c26b109c-0247-4c99-80c3-dccfa3d7ab06@googlegroups.com> <mailman.6517.1391845924.18130.python-list@python.org> <e5cc422f-e324-4ad3-9f24-cf8c462ddf15@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Gmane-NNTP-Posting-Host p57bd9cc2.dip0.t-ipconnect.de
User-Agent KNode/4.7.3
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6526.1391848759.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1391848759 news.xs4all.nl 2941 [2001:888:2000:d::a6]:39781
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65650

Show key headers only | View raw


Asaf Las wrote:

> On Saturday, February 8, 2014 9:51:48 AM UTC+2, Peter Otten wrote:
>> 
>> At least the mimetypes already defined in the module could easily produce
>> the same guessed extension consistently.
> 
> imho one workaround for OP could be to supply own map file in init() thus
> ensure unambiguous mapping across every platform and distribution. guess
> some libraries already doing that. or write wrapper and process
> all_guesses to eliminate ambiguity up to needed requirement.
> that is in case if bug request will be rejected.

You also have to set mimetypes.types_map and mimetypes.common_types to an 
empty dict (or an OrderedDict).

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Possible bug with stability of mimetypes.guess_* function output Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-02-07 19:06 +0100
  Re: Possible bug with stability of mimetypes.guess_* function output Asaf Las <roegltd@gmail.com> - 2014-02-07 11:09 -0800
    Re: Possible bug with stability of mimetypes.guess_* function output Asaf Las <roegltd@gmail.com> - 2014-02-07 11:17 -0800
      Re: Possible bug with stability of mimetypes.guess_* function output Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-07 19:28 +0000
    Re: Possible bug with stability of mimetypes.guess_* function output Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-02-07 20:39 +0100
    Re: Possible bug with stability of mimetypes.guess_* function output Peter Otten <__peter__@web.de> - 2014-02-07 20:40 +0100
      Re: Possible bug with stability of mimetypes.guess_* function output Asaf Las <roegltd@gmail.com> - 2014-02-07 12:25 -0800
        Re: Possible bug with stability of mimetypes.guess_* function output Peter Otten <__peter__@web.de> - 2014-02-08 08:51 +0100
          Re: Possible bug with stability of mimetypes.guess_* function output Asaf Las <roegltd@gmail.com> - 2014-02-08 00:24 -0800
            Re: Possible bug with stability of mimetypes.guess_* function output Peter Otten <__peter__@web.de> - 2014-02-08 09:39 +0100
              Re: Possible bug with stability of mimetypes.guess_* function output Asaf Las <roegltd@gmail.com> - 2014-02-08 02:59 -0800

csiph-web