Message331715
The mimetypes.guess_all_extensions function is defined as:
def guess_all_extensions(self, type, strict=True):
type = type.lower()
extensions = self.types_map_inv[True].get(type, [])
if not strict:
for ext in self.types_map_inv[False].get(type, []):
if ext not in extensions:
extensions.append(ext)
return extensions
If any mime type exists in both the strict and non-strict types_map_inv and it is called with strict=False, then it will modify the strict list in-place which effects future calls even with strict=True. While this doesn't manifest as an error for me because the dictionaries are non-overlapping, it is a potential error; it is also vulnerable to people accidentally modifying the returned list. The list should be copied after the first lookup. |
|
Date |
User |
Action |
Args |
2018-12-12 19:06:57 | rmccampbell7 | set | recipients:
+ rmccampbell7 |
2018-12-12 19:06:57 | rmccampbell7 | set | messageid: <1544641617.77.0.788709270274.issue35474@psf.upfronthosting.co.za> |
2018-12-12 19:06:57 | rmccampbell7 | link | issue35474 messages |
2018-12-12 19:06:57 | rmccampbell7 | create | |
|