hgweb: pre-init mimetypes module (fixes ugly bug in python-2.6.2 mimetypes)
The ugly initialization hack in mimetypes' initialization procedure can make
hg serve hit the maximum recursion depth when in threaded mode.
--- a/mercurial/hgweb/server.py Mon Apr 27 16:26:31 2009 +0200
+++ b/mercurial/hgweb/server.py Mon Apr 27 16:29:26 2009 +0200
@@ -283,6 +283,9 @@
else:
handler = _hgwebhandler
+ # ugly hack due to python issue5853 (for threaded use)
+ import mimetypes; mimetypes.init()
+
try:
if use_ipv6:
return IPv6HTTPServer((address, port), handler)