projects
/
file
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc32246
)
PR/7: Return the proper ValueError message
author
Christos Zoulas
<christos@zoulas.com>
Sat, 23 Jun 2018 14:57:53 +0000
(14:57 +0000)
committer
Christos Zoulas
<christos@zoulas.com>
Sat, 23 Jun 2018 14:57:53 +0000
(14:57 +0000)
python/magic.py
patch
|
blob
|
history
diff --git
a/python/magic.py
b/python/magic.py
index 662569e889d0441cd3df7853ab6d8f28b7b3ac86..377b55526b740d8f41360bdec40c81e1f48afed4 100644
(file)
--- a/
python/magic.py
+++ b/
python/magic.py
@@
-248,7
+248,10
@@
none_magic.load()
def _create_filemagic(mime_detected, type_detected):
- mime_type, mime_encoding = mime_detected.split('; ')
+ try:
+ mime_type, mime_encoding = mime_detected.split('; ')
+ except ValueError:
+ raise ValueError(mime_detected)
return FileMagic(name=type_detected, mime_type=mime_type,
encoding=mime_encoding.replace('charset=', ''))