[issue31040] mimetypes.add_type should complain when you give it an undotted ext

2019-09-13 Thread Julien Palard
Julien Palard added the comment: I just found a case where the empty mime type is actually usefull, it's in Lib/http/server.py: extensions_map = mimetypes.types_map.copy() extensions_map.update({ '': 'application/octet-stream', # Default '.py': 'text/plain',

[issue31040] mimetypes.add_type should complain when you give it an undotted ext

2019-09-13 Thread Julien Palard
Julien Palard added the comment: I think we should deprecate calling `add_type` with an empty `ext`, as I don't think it's a feature, more a side effect of the current implementation. But as some may use it like a feature, I asked the current PR to emit a warning, to not break the current

[issue31040] mimetypes.add_type should complain when you give it an undotted ext

2017-11-19 Thread Jim Jewett
Jim Jewett added the comment: Ideally, use .startswith('.') Instead if find, but this is a clear UI fix. First pull request fixes doc, second fixes code. OK to apply both. -- nosy: +Jim.Jewett stage: -> commit review ___

[issue31040] mimetypes.add_type should complain when you give it an undotted ext

2017-07-26 Thread Daniel Watkins
Changes by Daniel Watkins : -- pull_requests: +2948 ___ Python tracker ___ ___

[issue31040] mimetypes.add_type should complain when you give it an undotted ext

2017-07-25 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- assignee: -> docs@python components: +Documentation nosy: +docs@python versions: +Python 3.7 ___ Python tracker

[issue31040] mimetypes.add_type should complain when you give it an undotted ext

2017-07-25 Thread Daniel Watkins
Changes by Daniel Watkins : -- pull_requests: +2922 ___ Python tracker ___ ___

[issue31040] mimetypes.add_type should complain when you give it an undotted ext

2017-07-25 Thread Robert Jennings
Changes by Robert Jennings : -- nosy: +rcj ___ Python tracker ___ ___

[issue31040] mimetypes.add_type should complain when you give it an undotted ext

2017-07-25 Thread Daniel Watkins
New submission from Daniel Watkins: ``` import mimetypes print(mimetypes.guess_type('foo.manifest')) mimetypes.add_type('text/plain', 'manifest') print(mimetypes.guess_type('foo.manifest')) ``` results in: ``` ('application/x-ms-manifest', None) ('application/x-ms-manifest', None) ``` I