Message299135
```
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.) |
|
Date |
User |
Action |
Args |
2017-07-25 19:25:41 | odd_bloke | set | recipients:
+ odd_bloke |
2017-07-25 19:25:41 | odd_bloke | set | messageid: <1501010741.93.0.952054126016.issue31040@psf.upfronthosting.co.za> |
2017-07-25 19:25:41 | odd_bloke | link | issue31040 messages |
2017-07-25 19:25:41 | odd_bloke | create | |
|