Skip to content

Commit

Permalink
Fixed #66: too long paths in Windows while mime.types loading
Browse files Browse the repository at this point in the history
  • Loading branch information
jlgg committed Apr 12, 2016
1 parent a76bd12 commit cce457c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion yowsup/common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ def generatePreviewFromImage(image):
class MimeTools:
MIME_FILE = resource_string(__name__, 'mime.types')
mimetypes.init() # Load default mime.types
mimetypes.init([MIME_FILE]) # Append whatsapp mime.types
try:
mimetypes.init([MIME_FILE]) # Append whatsapp mime.types
except ValueError:
pass # In order to ignore "path too long for Windows" but just default mimetypes will be used.

@staticmethod
def getMIME(filepath):
Expand Down

0 comments on commit cce457c

Please sign in to comment.