Check if mimetypes was already inited.

#160 Merged at 643bd6d
Repository
VnC
Branch
2.4
Repository
openpyxl
Branch
2.4
Author
  1. VnC
Reviewers
Description

This avoids a Python bug when mimetypes is inited more than once:
https://bugs.python.org/issue4963

Comments (5)

  1. VnC author

    Yes, using openpyxl as dependency in a Django application. mimetypes.init() was called early in our Django config

    We upgraded openpyxl from 1.x to 2.4, and suddenly mimetypes.guess_all_extensions() behavior changed.

      1. VnC author

        OK with the envs I have on my machine

          py26: commands succeeded
          py27: commands succeeded
        ERROR:   py33: InterpreterNotFound: python3.3
        ERROR:   py34: InterpreterNotFound: python3.4
          py35: commands succeeded
        ERROR:   py36: InterpreterNotFound: python3.6
          nolxml: commands succeeded
          nolxml-py26: commands succeeded
          lxml: commands succeeded
          keep_vba: commands succeeded
        ERROR:   keep_vba-py34: InterpreterNotFound: python3.4
          nopillow: commands succeeded
          xfail: commands succeeded
          pandas: commands succeeded
          doc: commands succeeded
          doctest: commands succeeded