byrnereese/mkdocs-minify-plugin

Deprecation Warning: 'cgi' is deprecated and slated for removal in Python 3.13

Closed this issue · 1 comments

phuze commented

When executing either mkdocs serve or mkdocs build, a deprecation warning is thrown:

INFO  -  DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
           File "C:\Python\Python311\Lib\warnings.py", line 514, in _deprecated
             warn(msg, DeprecationWarning, stacklevel=3)
           File "C:\Python\Python311\Lib\site-packages\htmlmin\main.py", line 28, in
             import cgi

This is using the latest version of the plugin:

> pip show mkdocs-minify-plugin

Name: mkdocs-minify-plugin
Version: 0.6.1
Summary: An MkDocs plugin to minify HTML, JS or CSS files prior to being written to disk
Home-page: https://github.com/byrnereese/mkdocs-minify-plugin
Author: Byrne Reese, Lars Wilhelmer
Author-email: byrne@majordojo.com
License: MIT
Location: C:\Python\Python311\Lib\site-packages
Requires: csscompressor, htmlmin, jsmin, mkdocs
Required-by:

Along with the latest version of Python:

> python --version

Python 3.11.0

It looks like the warning stems from this packages use of mankyd/htmlmin. While I have submitted an issue over there, I am unsure of the project's status, as it hasn't seen any updates in nearly 5 years. It may be worth looking into an alternative HTML minifier.

Since version 1.4.0, MkDocs throws all kinds of DeprecationWarnings for me, from all kinds of plugins. IMHO, it's kinda spammy and I wish there was an option in MkDocs to disable that. So I woudn't consider that an issue of mkdocs-minify or htmlmin.

Once cgi is removed completely and htmlmin no longer works, we should of course update the plugin.