This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author odd_bloke
Recipients odd_bloke
Date 2017-07-25.19:25:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1501010741.93.0.952054126016.issue31040@psf.upfronthosting.co.za>
In-reply-to
Content
```
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 (mistakenly) expected the latter print to give me "('text/plain', None)".  It doesn't because I should have prepended a . to the second add_type argument.

I think add_type should error out when given an extension without a dot-prefix, because it's extremely unlikely that code that does so is behaving as intended with the current implementation.

(At the very least, documentation should be updated to make this expectation clearer.)
History
Date User Action Args
2017-07-25 19:25:41odd_blokesetrecipients: + odd_bloke
2017-07-25 19:25:41odd_blokesetmessageid: <1501010741.93.0.952054126016.issue31040@psf.upfronthosting.co.za>
2017-07-25 19:25:41odd_blokelinkissue31040 messages
2017-07-25 19:25:41odd_blokecreate